From a23e48df4514c4f40e832f196b1b50b1e5010bd2 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 17 Jan 2017 08:24:26 +0000 Subject: [PATCH] re PR testsuite/52563 (FAIL: gcc.dg/tree-ssa/scev-[3,4].c scan-tree-dump-times optimized "&a" 1) 2017-01-17 Richard Biener PR testsuite/52563 PR testsuite/71237 PR testsuite/77737 * gcc.dg/tree-ssa/scev-3.c: Re-write to a GIMPLE testcase for IVOPTs. * gcc.dg/tree-ssa/scev-4.c: Likewise. * gcc.dg/tree-ssa/scev-5.c: Likewise. From-SVN: r244519 --- gcc/testsuite/ChangeLog | 9 +++++ gcc/testsuite/gcc.dg/tree-ssa/scev-3.c | 43 ++++++++++++++++++----- gcc/testsuite/gcc.dg/tree-ssa/scev-4.c | 47 ++++++++++++++++++++------ gcc/testsuite/gcc.dg/tree-ssa/scev-5.c | 43 ++++++++++++++++++----- 4 files changed, 113 insertions(+), 29 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c00a050732b..add78e2f90f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2017-01-17 Richard Biener + + PR testsuite/52563 + PR testsuite/71237 + PR testsuite/77737 + * gcc.dg/tree-ssa/scev-3.c: Re-write to a GIMPLE testcase for IVOPTs. + * gcc.dg/tree-ssa/scev-4.c: Likewise. + * gcc.dg/tree-ssa/scev-5.c: Likewise. + 2017-01-17 Alan Modra * gcc.target/powerpc/pr79066.c: New. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c b/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c index 1346f26d6c1..fed1011968d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c @@ -1,18 +1,43 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fgimple -fdump-tree-ivopts" } */ int *a_p; int a[1000]; -void -f(int k) +void __GIMPLE (startwith ("loop")) +f (int k) { - int i; + int i; + int * _1; + +bb_2: + i_5 = k_4(D); + if (i_5 <= 999) + goto bb_4; + else + goto bb_3; + +bb_3: + return; + +bb_4: + ; + +bb_5: + i_12 = __PHI (bb_6: i_9, bb_4: i_5); + _1 = &a[i_12]; + a_p = _1; + __MEM ((int *)&a)[i_12] = 100; + i_9 = i_5 + i_12; + if (i_9 <= 999) + goto bb_6; + else + goto bb_3; + +bb_6: + ; + goto bb_5; - for (i=k; i<1000; i+=k) { - a_p = &a[i]; - *a_p = 100; - } } -/* { dg-final { scan-tree-dump-times "&a" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "&a" 1 "ivopts" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c b/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c index 99d033709af..94ebfae7b93 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c @@ -1,23 +1,48 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fgimple -fdump-tree-ivopts" } */ typedef struct { - int x; - int y; + int x; + int y; } S; int *a_p; S a[1000]; -void -f(int k) +void __GIMPLE (startwith ("loop")) +f (int k) { - int i; + int i; + int * _1; + +bb_2: + i_5 = k_4(D); + if (i_5 <= 999) + goto bb_4; + else + goto bb_3; + +bb_3: + return; + +bb_4: + ; + +bb_5: + i_12 = __PHI (bb_6: i_9, bb_4: i_5); + _1 = &a[i_12].y; + a_p = _1; + __MEM ((int *)&a)[i_12].y = 100; + i_9 = i_5 + i_12; + if (i_9 <= 999) + goto bb_6; + else + goto bb_3; + +bb_6: + ; + goto bb_5; - for (i=k; i<1000; i+=k) { - a_p = &a[i].y; - *a_p = 100; - } } -/* { dg-final { scan-tree-dump-times "&a" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "&a" 1 "ivopts" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-5.c b/gcc/testsuite/gcc.dg/tree-ssa/scev-5.c index 3f4a9cde2c2..8cced512e8d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/scev-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-5.c @@ -1,18 +1,43 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fgimple -fdump-tree-ivopts" } */ int *a_p; int a[1000]; -void -f(int k) +void __GIMPLE (startwith ("loop")) +f (int k) { - long long i; + long long int i; + int * _1; + +bb_2: + i_5 = (long long int) k_4(D); + if (i_5 <= 999ll) + goto bb_4; + else + goto bb_3; + +bb_3: + return; + +bb_4: + ; + +bb_5: + i_12 = __PHI (bb_6: i_9, bb_4: i_5); + _1 = &a[i_12]; + a_p = _1; + __MEM ((int *)&a)[i_12] = 100; + i_9 = i_5 + i_12; + if (i_9 <= 999ll) + goto bb_6; + else + goto bb_3; + +bb_6: + ; + goto bb_5; - for (i=k; i<1000; i+=k) { - a_p = &a[i]; - *a_p = 100; - } } -/* { dg-final { scan-tree-dump-times "&a" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "&a" 1 "ivopts" } } */ -- 2.30.2