OSDN Git Service

gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Jan 2009 22:00:18 +0000 (22:00 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Jan 2009 22:00:18 +0000 (22:00 +0000)
* function.h (rtl_data): Add a dbr_scheduled_p field.
* reorg.c (dbr_schedule): Set it.
(gate_handle_delay_slots): Check it.
* config/mips/mips.c (mips_base_delayed_branch): Delete.
(mips_reorg): Check flag_delayed_branch instead of
mips_base_delayed_branch.
(mips_override_options): Don't set mips_base_delayed_branch
or flag_delayed_branch.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143136 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/mips/mips.c
gcc/function.h
gcc/reorg.c

index 942d733..ff5d6f5 100644 (file)
@@ -1,5 +1,16 @@
 2009-01-06  Richard Sandiford  <rdsandiford@googlemail.com>
 
+       * function.h (rtl_data): Add a dbr_scheduled_p field.
+       * reorg.c (dbr_schedule): Set it.
+       (gate_handle_delay_slots): Check it.
+       * config/mips/mips.c (mips_base_delayed_branch): Delete.
+       (mips_reorg): Check flag_delayed_branch instead of
+       mips_base_delayed_branch.
+       (mips_override_options): Don't set mips_base_delayed_branch
+       or flag_delayed_branch.
+
+2009-01-06  Richard Sandiford  <rdsandiford@googlemail.com>
+
        PR rtl-optimization/38426.
        * ira.c (ira): Set current_function_is_leaf earlier.
 
index 290caa6..55b1c22 100644 (file)
@@ -453,7 +453,6 @@ static int mips_base_target_flags;
 bool mips_base_mips16;
 
 /* The ambient values of other global variables.  */
-static int mips_base_delayed_branch; /* flag_delayed_branch */
 static int mips_base_schedule_insns; /* flag_schedule_insns */
 static int mips_base_reorder_blocks_and_partition; /* flag_reorder... */
 static int mips_base_move_loop_invariants; /* flag_move_loop_invariants */
@@ -13297,7 +13296,7 @@ mips_reorg (void)
   mips16_lay_out_constants ();
   if (mips_r10k_cache_barrier != R10K_CACHE_BARRIER_NONE)
     r10k_insert_cache_barriers ();
-  if (mips_base_delayed_branch)
+  if (flag_delayed_branch)
     dbr_schedule (get_insns ());
   mips_reorg_process_insns ();
   if (!TARGET_MIPS16
@@ -14058,7 +14057,6 @@ mips_override_options (void)
 
   /* Save base state of options.  */
   mips_base_target_flags = target_flags;
-  mips_base_delayed_branch = flag_delayed_branch;
   mips_base_schedule_insns = flag_schedule_insns;
   mips_base_reorder_blocks_and_partition = flag_reorder_blocks_and_partition;
   mips_base_move_loop_invariants = flag_move_loop_invariants;
@@ -14071,9 +14069,6 @@ mips_override_options (void)
      Do all CPP-sensitive stuff in non-MIPS16 mode; we'll switch to
      MIPS16 mode afterwards if need be.  */
   mips_set_mips16_mode (false);
-
-  /* We call dbr_schedule from within mips_reorg.  */
-  flag_delayed_branch = 0;
 }
 
 /* Swap the register information for registers I and I + 1, which
index 68df55e..f78d737 100644 (file)
@@ -444,6 +444,9 @@ struct rtl_data GTY(())
   /* Nonzero if function stack realignment has been finalized, namely
      stack_realign_needed flag has been set and finalized after reload.  */
   bool stack_realign_finalized;
+
+  /* True if dbr_schedule has already been called for this function.  */
+  bool dbr_scheduled_p;
 };
 
 #define return_label (crtl->x_return_label)
index 97570e8..fd6a58e 100644 (file)
@@ -4038,6 +4038,7 @@ dbr_schedule (rtx first)
   }
 
 #endif
+  crtl->dbr_scheduled_p = true;
 }
 #endif /* DELAY_SLOTS */
 \f
@@ -4045,7 +4046,7 @@ static bool
 gate_handle_delay_slots (void)
 {
 #ifdef DELAY_SLOTS
-  return flag_delayed_branch;
+  return flag_delayed_branch && !crtl->dbr_scheduled_p;
 #else
   return 0;
 #endif