OSDN Git Service

2013-01-10 Vladimir Makarov <vmakarov@redhat.com>
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Jan 2013 20:07:55 +0000 (20:07 +0000)
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Jan 2013 20:07:55 +0000 (20:07 +0000)
PR rtl-optimization/pr55672
* lra-eliminations.c (mark_not_elimnable): Permit addition with
const to be elimnable.

2013-01-10  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/pr55672
* gcc.target/i386/pr55672.c: New.

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

gcc/ChangeLog
gcc/lra-eliminations.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr55672.c [new file with mode: 0644]

index 17554bd..58168c9 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-10  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/pr55672
+       * lra-eliminations.c (mark_not_elimnable): Permit addition with
+       const to be elimnable.
+
 2013-01-10  David Edelsohn  <dje.gcc@gmail.com>
 
        * configure.ac (HAVE_AS_TLS): Add check for powerpc-ibm-aix.
index 24c58f6..807ac16 100644 (file)
@@ -657,7 +657,7 @@ mark_not_eliminable (rtx x)
     case PRE_MODIFY:
       if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER)
        /* If we modify the source of an elimination rule, disable
-          it. Do the same if it is the source and not the hard frame
+          it.  Do the same if it is the source and not the hard frame
           register.  */
        for (ep = reg_eliminate;
             ep < &reg_eliminate[NUM_ELIMINABLE_REGS];
@@ -716,7 +716,10 @@ mark_not_eliminable (rtx x)
               ep < &reg_eliminate[NUM_ELIMINABLE_REGS];
               ep++)
            if (ep->to_rtx == SET_DEST (x)
-               && SET_DEST (x) != hard_frame_pointer_rtx)
+               && SET_DEST (x) != hard_frame_pointer_rtx
+               && (GET_CODE (SET_SRC (x)) != PLUS
+                   || XEXP (SET_SRC (x), 0) != SET_DEST (x)
+                   || ! CONST_INT_P (XEXP (SET_SRC (x), 1))))
              setup_can_eliminate (ep, false);
        }
 
index 6df9b9c..668dd36 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-10  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/pr55672
+       * gcc.target/i386/pr55672.c: New.
+
 2013-01-10  Jeff Law  <law@redhat.com>
 
        * gcc/dg/tree-ssa/vrp06.c: Tighten expected output.  Make each
diff --git a/gcc/testsuite/gcc.target/i386/pr55672.c b/gcc/testsuite/gcc.target/i386/pr55672.c
new file mode 100644 (file)
index 0000000..6f1c898
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstack-check=generic" } */
+
+int main ()
+{
+  int x[8];
+  if (x[0] != 4)
+    __builtin_abort ();
+  return 0;
+}