summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-28 01:02:30 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-28 01:02:30 +0000
commit20f49c66004b323facc5d2667ad0ddc85f9e8625 (patch)
tree2d38657323a3d2e67b703e150a05bfd52921735d
parent25b1440f06a8264f9e66e3bdd2faadc7ee97ad94 (diff)
downloadgcc-20f49c66004b323facc5d2667ad0ddc85f9e8625.tar.gz
2007-09-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/7003 * gcc.target/powerpc/gcse-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128856 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/powerpc/gcse-1.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index bfc1af73e67..fba430413ec 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/7003
+ * gcc.target/powerpc/gcse-1.c: New test.
+
2007-09-27 Tobias Schlüter <tobi@gcc.gnu.org>
* gfortran.dg/array_initializer_3.f90: Adapt error annotations for
diff --git a/gcc/testsuite/gcc.target/powerpc/gcse-1.c b/gcc/testsuite/gcc.target/powerpc/gcse-1.c
new file mode 100644
index 00000000000..799cde1dd0e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/gcse-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { *-*-linux* && ilp32 } } } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "@ha" 1 } } */
+
+
+/* Test for PR 7003, address of array loaded int register
+ twice without any need. */
+
+extern const char flags [256];
+
+unsigned char * f (unsigned char * s) {
+ while (flags[*++s]);
+ while (!flags[*++s]);
+ return s;
+}