diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr20100.c | 32 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr20115-1.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr20115.c | 28 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c | 5 |
5 files changed, 86 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ddaa9cc..530d9a3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2005-02-22 Diego Novillo <dnovillo@redhat.com> + + PR tree-optimization/20100 + PR tree-optimization/20115 + * gcc.dg/pr20115.c: New test. + * gcc.dg/pr20115-1.c: New test. + * gcc.dg/pr20100.c: New test. + * gcc.dg/tree-ssa/20040517-1.c: Expect virtual operands for + call-clobbered variables after alias1. + 2005-02-22 Bud Davis <bdavis@gfortran.org> * gfortran.dg/list_read_4.f90: new test. diff --git a/gcc/testsuite/gcc.dg/pr20100.c b/gcc/testsuite/gcc.dg/pr20100.c new file mode 100644 index 0000000..988fbda --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr20100.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +int func_pure (void) __attribute__ ((pure)); +void func_other (int); +int global_int; +void abort (); +void func_other(int a) +{ + if (a != global_int) + abort (); + global_int++; +} + +int func_pure(void) +{ + return global_int; +} + +int +func_loop (int arg) +{ + // global_int ++; + while (arg--) + func_other (func_pure ()); +} + +int main(void) +{ + func_loop(10); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr20115-1.c b/gcc/testsuite/gcc.dg/pr20115-1.c new file mode 100644 index 0000000..d1c4066 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr20115-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-dom1" } */ + +extern int foo (void) __attribute__((pure)); + +int bar() +{ + int a = foo (); + a += foo (); + return a; +} + +/* Check that we only have one call to foo. */ +/* { dg-final { scan-tree-dump-times "foo" 1 "dom1" } } */ diff --git a/gcc/testsuite/gcc.dg/pr20115.c b/gcc/testsuite/gcc.dg/pr20115.c new file mode 100644 index 0000000..cea4b48 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr20115.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +int func_pure (void); +void func_other (int); +int global_int; +int func_pure (void) { return global_int; } +void func_other (int a) +{ + global_int = a + 1; +} +int f(void) +{ + int a; + a = func_pure(); + func_other (a); + a = func_pure (); // We were removing this function call + return a; +} +void abort (void); + +int main(void) +{ + global_int = 10; + if (f() != 11) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c index 5f99be2..4b09b53 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-ssa-vops" } */ +/* { dg-options "-O1 -fdump-tree-alias1-vops" } */ extern void abort (void); int a; @@ -17,5 +17,4 @@ void bar (void) malloc functions may clobber global memory. Only the function result does not alias any other pointer. Hence, we must have a VDEF for a before and after the call to foo(). */ -/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 1 "ssa"} } */ - +/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 1 "alias1"} } */ |