This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] gcc.dg/tree-ssa/*.c: Use -O2 in some testcases.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dnovillo at redhat dot com
- Date: Mon, 09 May 2005 19:15:30 -0400 (EDT)
- Subject: [patch] gcc.dg/tree-ssa/*.c: Use -O2 in some testcases.
Hi,
Attached is a patch to use -O2 in some testcases.
In these testcases mentioned mentioned below, they specify
-fdump-tree-store_ccp, but they don't actually run store_ccp because
store_ccp is enabled at -O2 or higher. Neither do they strictly test
store_ccp. That is, some of them are testing the results of some
other optimization like DOM.
The patch partially fixes this problem by raising -O1 to -O2. In
20040721-1.c, I was able to disable DOM and still get expected
optimizations. In other testcases, we seem to at least partially
depend on DOM to get expected optimizations.
A complete fix would involve checking messages from the propagator so
that expected optimizations will happen in nothing but store_ccp, but
that's not as easy as I thought. For example, we can't just turn the
FRE portion of DOM and disable the rest, at least in the current pass
ordering.
Tested on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2005-05-09 Kazu Hirata <kazu@cs.umass.edu>
PR testsuite/21443
* gcc.dg/tree-ssa/20030731-2.c, gcc.dg/tree-ssa/20030917-1.c,
gcc.dg/tree-ssa/20030917-3.c, gcc.dg/tree-ssa/ssa-ccp-1.c,
gcc.dg/tree-ssa/ssa-ccp-2.c, gcc.dg/tree-ssa/ssa-ccp-3.c,
gcc.dg/tree-ssa/ssa-ccp-7.c, gcc.dg/tree-ssa/ssa-ccp-9.c:
Change -O1 to -O2.
* gcc.dg/tree-ssa/20040721-1.c: Change -O1 to -O2. Add
-fno-dominator-opts.
Index: testsuite/gcc.dg/tree-ssa/20030731-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c,v
retrieving revision 1.4
diff -u -d -p -r1.4 20030731-2.c
--- testsuite/gcc.dg/tree-ssa/20030731-2.c 9 Apr 2005 01:37:53 -0000 1.4
+++ testsuite/gcc.dg/tree-ssa/20030731-2.c 9 May 2005 14:39:59 -0000
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fdump-tree-store_ccp" } */
bar (int i, int partial, int args_addr)
Index: testsuite/gcc.dg/tree-ssa/20030917-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c,v
retrieving revision 1.4
diff -u -d -p -r1.4 20030917-1.c
--- testsuite/gcc.dg/tree-ssa/20030917-1.c 9 Apr 2005 01:37:53 -0000 1.4
+++ testsuite/gcc.dg/tree-ssa/20030917-1.c 9 May 2005 14:39:59 -0000
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fdump-tree-store_ccp" } */
extern int board[];
Index: testsuite/gcc.dg/tree-ssa/20030917-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c,v
retrieving revision 1.5
diff -u -d -p -r1.5 20030917-3.c
--- testsuite/gcc.dg/tree-ssa/20030917-3.c 9 Apr 2005 01:37:53 -0000 1.5
+++ testsuite/gcc.dg/tree-ssa/20030917-3.c 9 May 2005 14:39:59 -0000
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fno-tree-dominator-opts -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-store_ccp" } */
extern int printf (const char *, ...);
Index: testsuite/gcc.dg/tree-ssa/20040721-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c,v
retrieving revision 1.3
diff -u -d -p -r1.3 20040721-1.c
--- testsuite/gcc.dg/tree-ssa/20040721-1.c 9 Apr 2005 01:37:53 -0000 1.3
+++ testsuite/gcc.dg/tree-ssa/20040721-1.c 9 May 2005 14:39:59 -0000
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-store_ccp-vops" } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-store_ccp-vops" } */
/* Test to check whether global variables are being
constant propagated. */
Index: testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c,v
retrieving revision 1.4
diff -u -d -p -r1.4 ssa-ccp-1.c
--- testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c 9 Apr 2005 01:37:54 -0000 1.4
+++ testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c 9 May 2005 14:39:59 -0000
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fdump-tree-store_ccp" } */
extern void link_error (void);
Index: testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c,v
retrieving revision 1.4
diff -u -d -p -r1.4 ssa-ccp-2.c
--- testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c 9 Apr 2005 01:37:54 -0000 1.4
+++ testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c 9 May 2005 14:39:59 -0000
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fdump-tree-store_ccp" } */
extern void link_error (void);
Index: testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c,v
retrieving revision 1.4
diff -u -d -p -r1.4 ssa-ccp-3.c
--- testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c 9 Apr 2005 01:37:54 -0000 1.4
+++ testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c 9 May 2005 14:39:59 -0000
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fdump-tree-store_ccp" } */
extern void link_error (void);
Index: testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c,v
retrieving revision 1.4
diff -u -d -p -r1.4 ssa-ccp-7.c
--- testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c 9 Apr 2005 01:37:54 -0000 1.4
+++ testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c 9 May 2005 14:39:59 -0000
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fdump-tree-store_ccp" } */
extern void link_error (void);
Index: testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c,v
retrieving revision 1.4
diff -u -d -p -r1.4 ssa-ccp-9.c
--- testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c 9 Apr 2005 01:37:54 -0000 1.4
+++ testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c 9 May 2005 14:39:59 -0000
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-store_ccp" } */
+/* { dg-options "-O2 -fdump-tree-store_ccp" } */
/* Check that cprop works for assignments to array elements and structs. */