From 5e59d472ed3a8a191d443aa8093c61d1a351c6f3 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 14 Jun 2011 15:05:26 +0000 Subject: [PATCH] re PR middle-end/45098 (Missed induction variable optimization) 2011-06-14 Tom de Vries PR target/45098 * gcc.target/arm/ivopts-3.c: New test. * gcc.target/arm/ivopts-4.c: New test. * gcc.target/arm/ivopts-5.c: New test. From-SVN: r175025 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.target/arm/ivopts-3.c | 26 +++++++++++++++++++++++++ gcc/testsuite/gcc.target/arm/ivopts-4.c | 21 ++++++++++++++++++++ gcc/testsuite/gcc.target/arm/ivopts-5.c | 26 +++++++++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arm/ivopts-3.c create mode 100644 gcc/testsuite/gcc.target/arm/ivopts-4.c create mode 100644 gcc/testsuite/gcc.target/arm/ivopts-5.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4b7610d926f..a61de346908 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-06-14 Tom de Vries + + PR target/45098 + * gcc.target/arm/ivopts-3.c: New test. + * gcc.target/arm/ivopts-4.c: New test. + * gcc.target/arm/ivopts-5.c: New test. + 2011-06-14 Jakub Jelinek PR rtl-optimization/49390 diff --git a/gcc/testsuite/gcc.target/arm/ivopts-3.c b/gcc/testsuite/gcc.target/arm/ivopts-3.c new file mode 100644 index 00000000000..daea9474a2c --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/ivopts-3.c @@ -0,0 +1,26 @@ +/* { dg-do assemble } */ +/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */ + +extern unsigned int foo2 (short*) __attribute__((pure)); + +unsigned int +tr3 (short array[], unsigned int n) +{ + int sum = 0; + unsigned int x; + x = 0; + while (1) + { + sum += foo2 (&array[x]); + if (!(x < n)) + break; + x++; + } + return sum; +} + +/* { dg-final { scan-tree-dump-times "PHI 0) + for (x = 0; x < n; x++) + sum += foo (&array[x]); + return sum; +} + +/* { dg-final { scan-tree-dump-times "PHI