re PR c++/53602 (Libre Office causes an internal compiler error)
authorRichard Henderson <rth@redhat.com>
Sat, 9 Jun 2012 16:27:52 +0000 (09:27 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 9 Jun 2012 16:27:52 +0000 (09:27 -0700)
PR c++/53602
        * cfgcleanup.c (execute_jump): Rename from rest_of_handle_jump2.
        (pass_jump): Rename from pass_jump2.
        (execute_jump2, pass_jump2): New.
        * combine-stack-adj.c (rest_of_handle_stack_adjustments): Don't
        perform cfg cleanup here.  Move the test of PUSH_ROUNDING
        and ACCUMULATE_OUTGOING_ARGS test...
        (gate_handle_stack_adjustments): ... here.
        * passes.c (init_optimization_passes): Update for pass_jump2 rename.
        Place new pass_jump2 after pass_stack_adjustments.
        * tree-pass.h (pass_jump): Declare.

From-SVN: r188360

gcc/ChangeLog
gcc/cfgcleanup.c
gcc/combine-stack-adj.c
gcc/passes.c
gcc/tree-pass.h

index 5c6cc02..1342b2d 100644 (file)
@@ -1,3 +1,17 @@
+2012-06-09  Richard Henderson  <rth@redhat.com>
+
+       PR c++/53602
+       * cfgcleanup.c (execute_jump): Rename from rest_of_handle_jump2.
+       (pass_jump): Rename from pass_jump2.
+       (execute_jump2, pass_jump2): New.
+       * combine-stack-adj.c (rest_of_handle_stack_adjustments): Don't
+       perform cfg cleanup here.  Move the test of PUSH_ROUNDING
+       and ACCUMULATE_OUTGOING_ARGS test...
+       (gate_handle_stack_adjustments): ... here.
+       * passes.c (init_optimization_passes): Update for pass_jump2 rename.
+       Place new pass_jump2 after pass_stack_adjustments.
+       * tree-pass.h (pass_jump): Declare.
+
 2012-06-09  Kenneth Zadeck <zadeck@naturalbridge.com>
 
        * simplify-rtx.c (simplify_const_binary_operation): Fixed shift
index 619b274..1aa4cbb 100644 (file)
@@ -2990,7 +2990,7 @@ cleanup_cfg (int mode)
 }
 \f
 static unsigned int
-rest_of_handle_jump2 (void)
+execute_jump (void)
 {
   delete_trivially_dead_insns (get_insns (), max_reg_num ());
   if (dump_file)
@@ -3000,22 +3000,47 @@ rest_of_handle_jump2 (void)
   return 0;
 }
 
+struct rtl_opt_pass pass_jump =
+{
+ {
+  RTL_PASS,
+  "jump",                              /* name */
+  NULL,                                        /* gate */
+  execute_jump,                                /* execute */
+  NULL,                                        /* sub */
+  NULL,                                        /* next */
+  0,                                   /* static_pass_number */
+  TV_JUMP,                             /* tv_id */
+  0,                                   /* properties_required */
+  0,                                   /* properties_provided */
+  0,                                   /* properties_destroyed */
+  TODO_ggc_collect,                    /* todo_flags_start */
+  TODO_verify_rtl_sharing,             /* todo_flags_finish */
+ }
+};
+\f
+static unsigned int
+execute_jump2 (void)
+{
+  cleanup_cfg (flag_crossjumping ? CLEANUP_CROSSJUMP : 0);
+  return 0;
+}
 
 struct rtl_opt_pass pass_jump2 =
 {
  {
   RTL_PASS,
-  "jump",                               /* name */
-  NULL,                                 /* gate */
-  rest_of_handle_jump2,                        /* execute */
-  NULL,                                 /* sub */
-  NULL,                                 /* next */
-  0,                                    /* static_pass_number */
-  TV_JUMP,                              /* tv_id */
-  0,                                    /* properties_required */
-  0,                                    /* properties_provided */
-  0,                                    /* properties_destroyed */
-  TODO_ggc_collect,                     /* todo_flags_start */
-  TODO_verify_rtl_sharing,              /* todo_flags_finish */
+  "jump2",                             /* name */
+  NULL,                                        /* gate */
+  execute_jump2,                       /* execute */
+  NULL,                                        /* sub */
+  NULL,                                        /* next */
+  0,                                   /* static_pass_number */
+  TV_JUMP,                             /* tv_id */
+  0,                                   /* properties_required */
+  0,                                   /* properties_provided */
+  0,                                   /* properties_destroyed */
+  TODO_ggc_collect,                    /* todo_flags_start */
+  TODO_verify_rtl_sharing,             /* todo_flags_finish */
  }
 };
index b46fe3b..65e8f04 100644 (file)
@@ -626,26 +626,23 @@ combine_stack_adjustments_for_block (basic_block bb)
 static bool
 gate_handle_stack_adjustments (void)
 {
-  return flag_combine_stack_adjustments;
-}
-
-static unsigned int
-rest_of_handle_stack_adjustments (void)
-{
-  cleanup_cfg (flag_crossjumping ? CLEANUP_CROSSJUMP : 0);
-
   /* This is kind of a heuristic.  We need to run combine_stack_adjustments
      even for machines with possibly nonzero TARGET_RETURN_POPS_ARGS
      and ACCUMULATE_OUTGOING_ARGS.  We expect that only ports having
      push instructions will have popping returns.  */
 #ifndef PUSH_ROUNDING
-  if (!ACCUMULATE_OUTGOING_ARGS)
+  if (ACCUMULATE_OUTGOING_ARGS)
+    return false;
 #endif
-    {
-      df_note_add_problem ();
-      df_analyze ();
-      combine_stack_adjustments ();
-    }
+  return flag_combine_stack_adjustments;
+}
+
+static unsigned int
+rest_of_handle_stack_adjustments (void)
+{
+  df_note_add_problem ();
+  df_analyze ();
+  combine_stack_adjustments ();
   return 0;
 }
 
index bfd4ce3..3974231 100644 (file)
@@ -1515,7 +1515,7 @@ init_optimization_passes (void)
       struct opt_pass **p = &pass_rest_of_compilation.pass.sub;
       NEXT_PASS (pass_instantiate_virtual_regs);
       NEXT_PASS (pass_into_cfg_layout_mode);
-      NEXT_PASS (pass_jump2);
+      NEXT_PASS (pass_jump);
       NEXT_PASS (pass_lower_subreg);
       NEXT_PASS (pass_df_initialize_opt);
       NEXT_PASS (pass_cse);
@@ -1577,6 +1577,7 @@ init_optimization_passes (void)
          NEXT_PASS (pass_thread_prologue_and_epilogue);
          NEXT_PASS (pass_rtl_dse2);
          NEXT_PASS (pass_stack_adjustments);
+         NEXT_PASS (pass_jump2);
          NEXT_PASS (pass_peephole2);
          NEXT_PASS (pass_if_after_reload);
          NEXT_PASS (pass_regrename);
index aa2959c..0552937 100644 (file)
@@ -484,6 +484,7 @@ extern struct rtl_opt_pass pass_expand;
 extern struct rtl_opt_pass pass_instantiate_virtual_regs;
 extern struct rtl_opt_pass pass_rtl_fwprop;
 extern struct rtl_opt_pass pass_rtl_fwprop_addr;
+extern struct rtl_opt_pass pass_jump;
 extern struct rtl_opt_pass pass_jump2;
 extern struct rtl_opt_pass pass_lower_subreg;
 extern struct rtl_opt_pass pass_cse;