re PR debug/66691 (ICE on valid code at -O3 with -g enabled in simplify_subreg, at...
[gcc.git] / gcc / shrink-wrap.c
index 52cc033d666f83e1dd8705d978bbdc1aa95180ce..51c0e7bfd71ca0efab1c580aa2635f5cf0a7e306 100644 (file)
@@ -24,12 +24,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "rtl-error.h"
-#include "hash-set.h"
-#include "vec.h"
-#include "input.h"
 #include "alias.h"
 #include "symtab.h"
-#include "inchash.h"
 #include "tree.h"
 #include "fold-const.h"
 #include "stor-layout.h"
@@ -39,9 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "except.h"
 #include "hard-reg-set.h"
 #include "function.h"
-#include "hashtab.h"
 #include "rtl.h"
-#include "statistics.h"
 #include "insn-config.h"
 #include "expmed.h"
 #include "dojump.h"
@@ -547,7 +541,7 @@ try_shrink_wrapping (edge *entry_edge, edge orig_entry_edge,
        break;
       }
 
-  if (flag_shrink_wrap && HAVE_simple_return
+  if (SHRINK_WRAPPING_ENABLED
       && (targetm.profile_before_prologue () || !crtl->profile)
       && nonempty_prologue && !crtl->calls_eh_return)
     {
@@ -813,7 +807,6 @@ try_shrink_wrapping (edge *entry_edge, edge orig_entry_edge,
            FOR_EACH_BB_REVERSE_FN (bb, cfun)
              {
                basic_block copy_bb, tbb;
-               rtx_insn *insert_point;
                int eflags;
 
                if (!bitmap_clear_bit (&bb_tail, bb->index))
@@ -843,8 +836,8 @@ try_shrink_wrapping (edge *entry_edge, edge orig_entry_edge,
                    BB_COPY_PARTITION (copy_bb, bb);
                  }
 
-               insert_point = emit_note_after (NOTE_INSN_DELETED,
-                                               BB_END (copy_bb));
+               rtx_note *insert_point = emit_note_after (NOTE_INSN_DELETED,
+                                                         BB_END (copy_bb));
                emit_barrier_after (BB_END (copy_bb));
 
                tbb = bb;
@@ -1008,12 +1001,11 @@ convert_to_simple_return (edge entry_edge, edge orig_entry_edge,
          else if (*pdest_bb == NULL)
            {
              basic_block bb;
-             rtx_insn *start;
 
              bb = create_basic_block (NULL, NULL, exit_pred);
              BB_COPY_PARTITION (bb, e->src);
-             start = emit_jump_insn_after (gen_simple_return (),
-                                           BB_END (bb));
+             rtx_insn *ret = targetm.gen_simple_return ();
+             rtx_jump_insn *start = emit_jump_insn_after (ret, BB_END (bb));
              JUMP_LABEL (start) = simple_return_rtx;
              emit_barrier_after (start);