summaryrefslogtreecommitdiff
path: root/gcc/lower-subreg.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-22 12:56:47 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-22 12:56:47 +0000
commit030087e31b1253fb9ed6835a82e93a61ccc02493 (patch)
treee2bc6c7177a42d1b832555b60d0a854bcb834bd0 /gcc/lower-subreg.c
parentb4f314ea97f04620d290f3ae25d831f46692864f (diff)
parentac875fa40bf5429aff0612943d8c5705c4e11bb5 (diff)
downloadgcc-030087e31b1253fb9ed6835a82e93a61ccc02493.tar.gz
Merge from trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209623 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lower-subreg.c')
-rw-r--r--gcc/lower-subreg.c46
1 files changed, 15 insertions, 31 deletions
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index a1331c00507..ae935f76459 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -1371,7 +1371,7 @@ dump_choices (bool speed_p, const char *description)
fprintf (dump_file, "Choices when optimizing for %s:\n", description);
for (i = 0; i < MAX_MACHINE_MODE; i++)
- if (GET_MODE_SIZE (i) > UNITS_PER_WORD)
+ if (GET_MODE_SIZE ((enum machine_mode) i) > UNITS_PER_WORD)
fprintf (dump_file, " %s mode %s for copy lowering.\n",
choices[speed_p].move_modes_to_split[i]
? "Splitting"
@@ -1687,32 +1687,8 @@ decompose_multiword_subregs (bool decompose_copies)
BITMAP_FREE (subreg_context);
}
-/* Gate function for lower subreg pass. */
-
-static bool
-gate_handle_lower_subreg (void)
-{
- return flag_split_wide_types != 0;
-}
-
/* Implement first lower subreg pass. */
-static unsigned int
-rest_of_handle_lower_subreg (void)
-{
- decompose_multiword_subregs (false);
- return 0;
-}
-
-/* Implement second lower subreg pass. */
-
-static unsigned int
-rest_of_handle_lower_subreg2 (void)
-{
- decompose_multiword_subregs (true);
- return 0;
-}
-
namespace {
const pass_data pass_data_lower_subreg =
@@ -1720,7 +1696,6 @@ const pass_data pass_data_lower_subreg =
RTL_PASS, /* type */
"subreg1", /* name */
OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_gate */
true, /* has_execute */
TV_LOWER_SUBREG, /* tv_id */
0, /* properties_required */
@@ -1738,8 +1713,12 @@ public:
{}
/* opt_pass methods: */
- bool gate () { return gate_handle_lower_subreg (); }
- unsigned int execute () { return rest_of_handle_lower_subreg (); }
+ virtual bool gate (function *) { return flag_split_wide_types != 0; }
+ virtual unsigned int execute (function *)
+ {
+ decompose_multiword_subregs (false);
+ return 0;
+ }
}; // class pass_lower_subreg
@@ -1751,6 +1730,8 @@ make_pass_lower_subreg (gcc::context *ctxt)
return new pass_lower_subreg (ctxt);
}
+/* Implement second lower subreg pass. */
+
namespace {
const pass_data pass_data_lower_subreg2 =
@@ -1758,7 +1739,6 @@ const pass_data pass_data_lower_subreg2 =
RTL_PASS, /* type */
"subreg2", /* name */
OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_gate */
true, /* has_execute */
TV_LOWER_SUBREG, /* tv_id */
0, /* properties_required */
@@ -1777,8 +1757,12 @@ public:
{}
/* opt_pass methods: */
- bool gate () { return gate_handle_lower_subreg (); }
- unsigned int execute () { return rest_of_handle_lower_subreg2 (); }
+ virtual bool gate (function *) { return flag_split_wide_types != 0; }
+ virtual unsigned int execute (function *)
+ {
+ decompose_multiword_subregs (true);
+ return 0;
+ }
}; // class pass_lower_subreg2