OSDN Git Service

PR rtl-optimization/39871
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Jun 2010 21:51:55 +0000 (21:51 +0000)
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Jun 2010 21:51:55 +0000 (21:51 +0000)
* reload1.c (init_eliminable_invariants): For flag_pic, disable
equivalences only for constants that aren't LEGITIMATE_PIC_OPERAND_P.
(function_invariant_p): Rule out a plus of frame or arg pointer with
a SYMBOL_REF.
* ira.c (find_reg_equiv_invariant_const): Likewise.

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

gcc/ChangeLog
gcc/ira.c
gcc/reload1.c

index f68d673..78dfa04 100644 (file)
@@ -1,3 +1,12 @@
+2010-06-17  Bernd Schmidt  <bernds@codesourcery.com>
+
+       PR rtl-optimization/39871
+       * reload1.c (init_eliminable_invariants): For flag_pic, disable
+       equivalences only for constants that aren't LEGITIMATE_PIC_OPERAND_P.
+       (function_invariant_p): Rule out a plus of frame or arg pointer with
+       a SYMBOL_REF.
+       * ira.c (find_reg_equiv_invariant_const): Likewise.
+
 2010-06-17  Gunther Nikl  <gnikl@users.sourceforge.net>
 
        * config/rs6000/rs6000.c (print_operand) <'K'>: Also use
index bd65d54..83a4358 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1586,12 +1586,8 @@ find_reg_equiv_invariant_const (void)
 
          x = XEXP (note, 0);
 
-         if (! function_invariant_p (x)
-             || ! flag_pic
-             /* 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 (x) && LEGITIMATE_PIC_OPERAND_P (x)))
+         if (! CONSTANT_P (x)
+             || ! flag_pic || LEGITIMATE_PIC_OPERAND_P (x))
            {
              /* It can happen that a REG_EQUIV note contains a MEM
                 that is not a legitimate memory operand.  As later
index f3d61c6..00d4c99 100644 (file)
@@ -4151,13 +4151,9 @@ init_eliminable_invariants (rtx first, bool do_subregs)
          if (i <= LAST_VIRTUAL_REGISTER)
            continue;
 
-         if (! function_invariant_p (x)
-             || ! flag_pic
-             /* 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 (x)
-                 && LEGITIMATE_PIC_OPERAND_P (x)))
+         /* If flag_pic and we have constant, verify it's legitimate.  */
+         if (!CONSTANT_P (x)
+             || !flag_pic || LEGITIMATE_PIC_OPERAND_P (x))
            {
              /* It can happen that a REG_EQUIV note contains a MEM
                 that is not a legitimate memory operand.  As later
@@ -6004,7 +6000,7 @@ function_invariant_p (const_rtx x)
     return 1;
   if (GET_CODE (x) == PLUS
       && (XEXP (x, 0) == frame_pointer_rtx || XEXP (x, 0) == arg_pointer_rtx)
-      && CONSTANT_P (XEXP (x, 1)))
+      && GET_CODE (XEXP (x, 1)) == CONST_INT)
     return 1;
   return 0;
 }