]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
df-problems.c (df_lr_local_compute): Manually CSE PIC_OFFSET_TABLE_REGNUM.
authorJeff Law <law@redhat.com>
Wed, 15 Jun 2011 16:23:28 +0000 (10:23 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 15 Jun 2011 16:23:28 +0000 (10:23 -0600)
* df-problems.c (df_lr_local_compute): Manually CSE
PIC_OFFSET_TABLE_REGNUM.
* df-scan.c (df_get_regular_block_artificial_uses): Likewise.
(df_get_entry_block_def_set, df_get_exit_block_use_set): Likewise.

From-SVN: r175081

gcc/ChangeLog
gcc/df-problems.c
gcc/df-scan.c

index 142856a5b478818fa6fcae0d0dbe20beffedcfe8..6ce868bf82bb6953ce0a2978823e06944431876a 100644 (file)
@@ -1,3 +1,10 @@
+2011-05-06  Jeff Law  <law@redhat.com>
+
+       * df-problems.c (df_lr_local_compute): Manually CSE
+       PIC_OFFSET_TABLE_REGNUM.
+       * df-scan.c (df_get_regular_block_artificial_uses): Likewise.
+       (df_get_entry_block_def_set, df_get_exit_block_use_set): Likewise.
+
 2011-06-13  Jan Hubicka  <jh@suse.cz>
 
        * cgraphunit.c (handle_alias_pairs): New function.
index e5b88e3d2dcf74097011e3171357c446d1e61f01..59bed8bd66791a2bb08f68872ea49f217b1dfef6 100644 (file)
@@ -906,6 +906,7 @@ df_lr_local_compute (bitmap all_blocks ATTRIBUTE_UNUSED)
      blocks within infinite loops.  */
   if (!reload_completed)
     {
+      unsigned int pic_offset_table_regnum = PIC_OFFSET_TABLE_REGNUM;
       /* Any reference to any pseudo before reload is a potential
         reference of the frame pointer.  */
       bitmap_set_bit (&df->hardware_regs_used, FRAME_POINTER_REGNUM);
@@ -919,9 +920,9 @@ df_lr_local_compute (bitmap all_blocks ATTRIBUTE_UNUSED)
 
       /* Any constant, or pseudo with constant equivalences, may
         require reloading from memory using the pic register.  */
-      if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
-         && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
-       bitmap_set_bit (&df->hardware_regs_used, PIC_OFFSET_TABLE_REGNUM);
+      if (pic_offset_table_regnum != INVALID_REGNUM
+         && fixed_regs[pic_offset_table_regnum])
+       bitmap_set_bit (&df->hardware_regs_used, pic_offset_table_regnum);
     }
 
   EXECUTE_IF_SET_IN_BITMAP (df_lr->out_of_date_transfer_functions, 0, bb_index, bi)
index 42b4b145c02d98459d67f8b21324cf8538f14643..7179051f0b85684aa4973749e46d3a45257166a0 100644 (file)
@@ -3625,6 +3625,8 @@ df_get_regular_block_artificial_uses (bitmap regular_block_artificial_uses)
        live everywhere -- which might not already be the case for
        blocks within infinite loops.  */
     {
+      unsigned int picreg = PIC_OFFSET_TABLE_REGNUM;
+
       /* Any reference to any pseudo before reload is a potential
         reference of the frame pointer.  */
       bitmap_set_bit (regular_block_artificial_uses, FRAME_POINTER_REGNUM);
@@ -3642,9 +3644,9 @@ df_get_regular_block_artificial_uses (bitmap regular_block_artificial_uses)
 
       /* Any constant, or pseudo with constant equivalences, may
         require reloading from memory using the pic register.  */
-      if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
-         && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
-       bitmap_set_bit (regular_block_artificial_uses, PIC_OFFSET_TABLE_REGNUM);
+      if (picreg != INVALID_REGNUM
+         && fixed_regs[picreg])
+       bitmap_set_bit (regular_block_artificial_uses, picreg);
     }
   /* The all-important stack pointer must always be live.  */
   bitmap_set_bit (regular_block_artificial_uses, STACK_POINTER_REGNUM);
@@ -3779,6 +3781,10 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
   /* These registers are live everywhere.  */
   if (!reload_completed)
     {
+#ifdef PIC_OFFSET_TABLE_REGNUM
+      unsigned int picreg = PIC_OFFSET_TABLE_REGNUM;
+#endif
+
 #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
       /* Pseudos with argument area equivalences may require
         reloading via the argument pointer.  */
@@ -3789,9 +3795,9 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
 #ifdef PIC_OFFSET_TABLE_REGNUM
       /* Any constant, or pseudo with constant equivalences, may
         require reloading from memory using the pic register.  */
-      if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
-         && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
-       bitmap_set_bit (entry_block_defs, PIC_OFFSET_TABLE_REGNUM);
+      if (picreg != INVALID_REGNUM
+         && fixed_regs[picreg])
+       bitmap_set_bit (entry_block_defs, picreg);
 #endif
     }
 
@@ -3889,6 +3895,7 @@ static void
 df_get_exit_block_use_set (bitmap exit_block_uses)
 {
   unsigned int i;
+  unsigned int picreg = PIC_OFFSET_TABLE_REGNUM;
 
   bitmap_clear (exit_block_uses);
 
@@ -3913,9 +3920,9 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
      Assume the pic register is not in use, or will be handled by
      other means, if it is not fixed.  */
   if (!PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
-      && (unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
-      && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
-    bitmap_set_bit (exit_block_uses, PIC_OFFSET_TABLE_REGNUM);
+      && picreg != INVALID_REGNUM
+      && fixed_regs[picreg])
+    bitmap_set_bit (exit_block_uses, picreg);
 
   /* Mark all global registers, and all registers used by the
      epilogue as being live at the end of the function since they