From e054362c4a32db8c6ec5ff244c2abdeeaba25616 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 19 May 2011 09:33:49 +0000 Subject: [PATCH] re PR middle-end/45098 (Missed induction variable optimization) 2011-05-19 Tom de Vries PR target/45098 * gcc.target/arm/ivopts.c: New test. * gcc.target/arm/ivopts-2.c: New test. From-SVN: r173896 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.target/arm/ivopts-2.c | 18 ++++++++++++++++++ gcc/testsuite/gcc.target/arm/ivopts.c | 15 +++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arm/ivopts-2.c create mode 100644 gcc/testsuite/gcc.target/arm/ivopts.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a9af18eeae3..f9defe50594 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-05-19 Tom de Vries + + PR target/45098 + * gcc.target/arm/ivopts.c: New test. + * gcc.target/arm/ivopts-2.c: New test. + 2011-05-19 Tom de Vries * lib/lib/scanasm.exp (object-size): Fix target selector handling. 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 00000000000..4aba3cfb75c --- /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 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" } } */ -- 2.30.2