]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tm.texi.in (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Document to be zero or nonzero.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 20 Aug 2010 11:14:38 +0000 (12:14 +0100)
committerAndrew Stubbs <ams@gcc.gnu.org>
Fri, 20 Aug 2010 11:14:38 +0000 (11:14 +0000)
2010-08-20  Joseph Myers  <joseph@codesourcery.com>

gcc/
* doc/tm.texi.in (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Document to
be zero or nonzero.
* doc/tm.texi: Regenerate.
* defaults.h (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Define.
* df-scan.c (df_get_exit_block_use_set), reginfo.c
(init_reg_sets_1), rtlanal.c (rtx_unstable_p, rtx_varies_p):
Handle new PIC_OFFSET_TABLE_REG_CALL_CLOBBERED semantics.
* config/ia64/ia64.h (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Define
to 1.

From-SVN: r163399

gcc/ChangeLog
gcc/config/ia64/ia64.h
gcc/defaults.h
gcc/df-scan.c
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/reginfo.c
gcc/rtlanal.c

index 31762851e516ca976cb8ae05ea06acc6951998cc..11a82db620bfd2479dd41272217cfc92cf72d0df 100644 (file)
@@ -1,3 +1,15 @@
+2010-08-20  Joseph Myers  <joseph@codesourcery.com>
+
+       * doc/tm.texi.in (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Document to
+       be zero or nonzero.
+       * doc/tm.texi: Regenerate.
+       * defaults.h (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Define.
+       * df-scan.c (df_get_exit_block_use_set), reginfo.c
+       (init_reg_sets_1), rtlanal.c (rtx_unstable_p, rtx_varies_p):
+       Handle new PIC_OFFSET_TABLE_REG_CALL_CLOBBERED semantics.
+       * config/ia64/ia64.h (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Define
+       to 1.
+
 2010-08-20  Olivier Hainque  <hainque@adacore.com>
 
        * config/sparc/sparc.c (sparc_asm_function_epilogue): Don't output
index 39fa25ccc5ff9df4d6f51cfa32ecb860243fdd11..b43d075f3c1333e1cbbe1546448c366180224013 100644 (file)
@@ -1359,7 +1359,7 @@ do {                                                                      \
 /* Define this macro if the register defined by `PIC_OFFSET_TABLE_REGNUM' is
    clobbered by calls.  */
 
-#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
+#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 1
 
 \f
 /* The Overall Framework of an Assembler File.  */
index 7aa227c3ff9a2adc3734c85eb81166f42ece389f..aaf6ea66de9e6d084762915b9da96eddd3829fec 100644 (file)
@@ -722,6 +722,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
 #endif
 
+#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
+#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 0
+#endif
+
 #ifndef TARGET_DLLIMPORT_DECL_ATTRIBUTES
 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 0
 #endif
index b4633abfb10c29efdc2439fcaa73d4f251793c50..8b17ae2948898197457cf852b6f81d47ff263984 100644 (file)
@@ -4032,14 +4032,13 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
 #endif
     }
 
-#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
   /* Many architectures have a GP register even without flag_pic.
      Assume the pic register is not in use, or will be handled by
      other means, if it is not fixed.  */
-  if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
+  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);
-#endif
 
   /* Mark all global registers, and all registers used by the
      epilogue as being live at the end of the function since they
index 3e38618e79c92bf7166a7ca6883effb7a46578da..7e8765b363852211bf932fdd25180b209c671875 100644 (file)
@@ -7128,8 +7128,9 @@ when @code{flag_pic} is true).
 @end defmac
 
 @defmac PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
-Define this macro if the register defined by
-@code{PIC_OFFSET_TABLE_REGNUM} is clobbered by calls.  Do not define
+A C expression that is nonzero if the register defined by
+@code{PIC_OFFSET_TABLE_REGNUM} is clobbered by calls.  If not defined,
+the default is zero.  Do not define
 this macro if @code{PIC_OFFSET_TABLE_REGNUM} is not defined.
 @end defmac
 
index 63589168f8d0426c9966fb9290c44b3bc1a78756..4d13cbe86874d2c26c1064e9c5aede55159dce87 100644 (file)
@@ -7123,8 +7123,9 @@ when @code{flag_pic} is true).
 @end defmac
 
 @defmac PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
-Define this macro if the register defined by
-@code{PIC_OFFSET_TABLE_REGNUM} is clobbered by calls.  Do not define
+A C expression that is nonzero if the register defined by
+@code{PIC_OFFSET_TABLE_REGNUM} is clobbered by calls.  If not defined,
+the default is zero.  Do not define
 this macro if @code{PIC_OFFSET_TABLE_REGNUM} is not defined.
 @end defmac
 
index 1510ce84ec5df13e4b1b16040dc5d3d55896fa5f..879f50b08257e26519a7b5c6026f01c56d957b16 100644 (file)
@@ -495,10 +495,9 @@ init_reg_sets_1 (void)
       else if (i == ARG_POINTER_REGNUM && fixed_regs[i])
        ;
 #endif
-#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
-      else if (i == (unsigned) PIC_OFFSET_TABLE_REGNUM && fixed_regs[i])
+      else if (!PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
+              && i == (unsigned) PIC_OFFSET_TABLE_REGNUM && fixed_regs[i])
        ;
-#endif
       else if (CALL_REALLY_USED_REGNO_P (i))
         {
          SET_HARD_REG_BIT (regs_invalidated_by_call, i);
index f9e687157e3d7d746f1d5650d31ca481cd439ded..4331f416b253639a9fa5d04f57ac4add20bc8490 100644 (file)
@@ -118,13 +118,11 @@ rtx_unstable_p (const_rtx x)
          /* The arg pointer varies if it is not a fixed register.  */
          || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]))
        return 0;
-#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
       /* ??? When call-clobbered, the value is stable modulo the restore
         that must happen after a call.  This currently screws up local-alloc
         into believing that the restore is not needed.  */
-      if (x == pic_offset_table_rtx)
+      if (!PIC_OFFSET_TABLE_REG_CALL_CLOBBERED && x == pic_offset_table_rtx)
        return 0;
-#endif
       return 1;
 
     case ASM_OPERANDS:
@@ -197,14 +195,11 @@ rtx_varies_p (const_rtx x, bool for_alias)
          || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]))
        return 0;
       if (x == pic_offset_table_rtx
-#ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
          /* ??? When call-clobbered, the value is stable modulo the restore
             that must happen after a call.  This currently screws up
             local-alloc into believing that the restore is not needed, so we
             must return 0 only if we are called from alias analysis.  */
-         && for_alias
-#endif
-         )
+         && (!PIC_OFFSET_TABLE_REG_CALL_CLOBBERED || for_alias))
        return 0;
       return 1;