aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2011-05-19 09:33:49 +0000
committerTom de Vries <vries@gcc.gnu.org>2011-05-19 09:33:49 +0000
commite054362c4a32db8c6ec5ff244c2abdeeaba25616 (patch)
treed1cca07d7dccdc40c66157905e5ac372275c3305 /gcc
parente7b705a7350ca258fd9f0d1276500fec7fea16f3 (diff)
downloadgcc-e054362c4a32db8c6ec5ff244c2abdeeaba25616.zip
gcc-e054362c4a32db8c6ec5ff244c2abdeeaba25616.tar.gz
gcc-e054362c4a32db8c6ec5ff244c2abdeeaba25616.tar.bz2
re PR middle-end/45098 (Missed induction variable optimization)
2011-05-19 Tom de Vries <tom@codesourcery.com> PR target/45098 * gcc.target/arm/ivopts.c: New test. * gcc.target/arm/ivopts-2.c: New test. From-SVN: r173896
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.target/arm/ivopts-2.c18
-rw-r--r--gcc/testsuite/gcc.target/arm/ivopts.c15
3 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a9af18e..f9defe5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2011-05-19 Tom de Vries <tom@codesourcery.com>
+ PR target/45098
+ * gcc.target/arm/ivopts.c: New test.
+ * gcc.target/arm/ivopts-2.c: New test.
+
+2011-05-19 Tom de Vries <tom@codesourcery.com>
+
* lib/lib/scanasm.exp (object-size): Fix target selector handling.
2011-05-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
diff --git a/gcc/testsuite/gcc.target/arm/ivopts-2.c b/gcc/testsuite/gcc.target/arm/ivopts-2.c
new file mode 100644
index 0000000..4aba3cf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/ivopts-2.c
@@ -0,0 +1,18 @@
+/* { dg-do assemble } */
+/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */
+
+extern void foo2 (short*);
+
+void
+tr4 (short array[], int n)
+{
+ int x;
+ if (n > 0)
+ for (x = 0; x < n; x++)
+ foo2 (&array[x]);
+}
+
+/* { dg-final { scan-tree-dump-times "PHI <ivtmp" 1 "ivopts"} } */
+/* { dg-final { scan-tree-dump-times "PHI <" 1 "ivopts"} } */
+/* { dg-final { object-size text <= 26 { target arm_thumb2_ok } } } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc/testsuite/gcc.target/arm/ivopts.c b/gcc/testsuite/gcc.target/arm/ivopts.c
new file mode 100644
index 0000000..2d67e0a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/ivopts.c
@@ -0,0 +1,15 @@
+/* { dg-do assemble } */
+/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */
+
+void
+tr5 (short array[], int n)
+{
+ int x;
+ if (n > 0)
+ for (x = 0; x < n; x++)
+ array[x] = 0;
+}
+
+/* { dg-final { scan-tree-dump-times "PHI <" 1 "ivopts"} } */
+/* { dg-final { object-size text <= 20 { target arm_thumb2_ok } } } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */