summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraksit <raksit@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-11 04:20:32 +0000
committerraksit <raksit@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-11 04:20:32 +0000
commit5bed1dca2160c7761b2274c33088cece233d5ac8 (patch)
treec20963f4cf9d25ceb53cacc6ed4dbca6306ab622
parent8fbaeb05fd21c2467b03a3c5ea96e8b6678f1f8e (diff)
downloadgcc-5bed1dca2160c7761b2274c33088cece233d5ac8.tar.gz
gcc/ChangeLog
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/combine.c9
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr27971.c12
4 files changed, 32 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5a47a8c611c..0e5dbd6cf5b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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...
diff --git a/gcc/combine.c b/gcc/combine.c
index b3d064d3f11..43623a4fbc4 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -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:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7546770c97b..1e1207b1bd6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..8c706adda59
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr27971.c
@@ -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" } } */