reload1.c (reload): Check CONSTANT_P before calling LEGITIMATE_PIC_OPERAND_P.
authorHans-Peter Nilsson <hp@axis.com>
Sat, 20 Oct 2001 15:10:11 +0000 (15:10 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Sat, 20 Oct 2001 15:10:11 +0000 (15:10 +0000)
* reload1.c (reload): Check CONSTANT_P before calling
LEGITIMATE_PIC_OPERAND_P.
* config/cris/cris.c (cris_legitimate_pic_operand): Revert
workaround of 2001-10-13.

From-SVN: r46381

gcc/ChangeLog
gcc/config/cris/cris.c
gcc/reload1.c

index 04f1414538d0aacab8d6c15139e57f910bb35bb2..984104ddd4db01ea6af1a48907f2188504f50f0f 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-20  Hans-Peter Nilsson  <hp@axis.com>
+
+       * reload1.c (reload): Check CONSTANT_P before calling
+       LEGITIMATE_PIC_OPERAND_P.
+       * config/cris/cris.c (cris_legitimate_pic_operand): Revert
+       workaround of 2001-10-13.
+
 Sat Oct 20 15:16:10 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
        * i386.c (split_di): Handle splitting of DFmode.
index 4a9e08d0a9f524b5f6b6a9e8221a0f5110147f9e..668811ee010d01dcc44c0e6b3418955cd2db2391 100644 (file)
@@ -2239,12 +2239,6 @@ int
 cris_legitimate_pic_operand (x)
      rtx x;
 {
-  /* This test is due to a bug in the core of GCC.  See
-     <URL:http://gcc.gnu.org/ml/gcc-patches/2001-09/msg01038.html> for the
-     real fix; we shouldn't need to test CONSTANT_P here.  */
-  if (! CONSTANT_P (x))
-    return 0;
-
   /* The PIC representation of a symbol with a GOT entry will be (for
      example; relocations differ):
       sym => [rPIC+sym:GOT]
index 2be0983a2acc676403ccf0ee0153b333f1b9a08d..0b53ac90501d4d9a4c19a50a3f31a9749b39421c 100644 (file)
@@ -778,7 +778,11 @@ reload (first, global)
 #ifdef LEGITIMATE_PIC_OPERAND_P
              && (! function_invariant_p (XEXP (note, 0))
                  || ! flag_pic
-                 || LEGITIMATE_PIC_OPERAND_P (XEXP (note, 0)))
+                 /* A function invariant is often CONSTANT_P but may
+                    include a register.  We promise to only pass
+                    CONSTANT_P objects to LEGITIMATE_PIC_OPERAND_P.  */
+                 || (CONSTANT_P (XEXP (note, 0))
+                     && LEGITIMATE_PIC_OPERAND_P (XEXP (note, 0))))
 #endif
              )
            {