OSDN Git Service

gcc/ChangeLog
authorraksit <raksit@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Jan 2008 04:20:32 +0000 (04:20 +0000)
committerraksit <raksit@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Jan 2008 04:20:32 +0000 (04:20 +0000)
       PR rtl-optimization/27971
       * combine.c (find_split_point): introduced a new split for certain
       types of mem rtx.

gcc/testsuite/ChangeLog

       PR rtl-optimization/27971
       * gcc.target/i386/pr27971.c: New testcase.

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

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr27971.c [new file with mode: 0644]

index 5a47a8c..0e5dbd6 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-10  Raksit Ashok  <raksit@google.com>
+
+       PR rtl-optimization/27971
+       * combine.c (find_split_point): introduced a new split for certain
+       types of mem rtx.
+
 2008-01-10  DJ Delorie  <dj@redhat.com>
 
        * config/m32c/m32c.c (m32c_hard_regno_nregs_1): Renamed from...
index b3d064d..43623a4 100644 (file)
@@ -3967,6 +3967,15 @@ find_split_point (rtx *loc, rtx insn)
                         && OBJECT_P (SUBREG_REG (XEXP (XEXP (x, 0), 0)))))
            return &XEXP (XEXP (x, 0), 0);
        }
+
+      /* If we have a PLUS whose first operand is complex, try computing it
+         separately by making a split there.  */
+      if (GET_CODE (XEXP (x, 0)) == PLUS
+          && ! memory_address_p (GET_MODE (x), XEXP (x, 0))
+          && ! OBJECT_P (XEXP (XEXP (x, 0), 0))
+          && ! (GET_CODE (XEXP (XEXP (x, 0), 0)) == SUBREG
+                && OBJECT_P (SUBREG_REG (XEXP (XEXP (x, 0), 0)))))
+        return &XEXP (XEXP (x, 0), 0);
       break;
 
     case SET:
index 7546770..1e1207b 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-10  Raksit Ashok  <raksit@google.com>
+
+       PR rtl-optimization/27971
+       * gcc.target/i386/pr27971.c: New testcase.
+
 2008-01-10  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/34396
diff --git a/gcc/testsuite/gcc.target/i386/pr27971.c b/gcc/testsuite/gcc.target/i386/pr27971.c
new file mode 100644 (file)
index 0000000..8c706ad
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned array[4];
+
+unsigned foo(unsigned long x)
+{
+          return array[(x>>2)&3ul];
+}
+
+/* { dg-final { scan-assembler-not "shr\[^\\n\]*2" } } */
+/* { dg-final { scan-assembler "and\[^\\n\]*12" } } */