This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] New optimization test
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 17 Sep 2003 21:18:52 -0600
- Subject: [tree-ssa] New optimization test
- Reply-to: law at redhat dot com
This tests for something Andrew pointed out to me today... We're missing
some optimization opportunities in CCP due to trivial type differences.
* gcc.dg/tree-ssa/20030917-3.c: New test.
Index: gcc.dg/tree-ssa/20030917-3.c
===================================================================
RCS file: gcc.dg/tree-ssa/20030917-3.c
diff -N gcc.dg/tree-ssa/20030917-3.c
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- gcc.dg/tree-ssa/20030917-3.c 18 Sep 2003 03:10:57 -0000
***************
*** 0 ****
--- 1,24 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O1 -fno-tree-dominator-opts -fdump-tree-ccp" } */
+
+
+ main ()
+ {
+ int variable = 0;
+ int p = 1;
+ while (1)
+ {
+ if (p)
+ break;
+ variable = variable + 1;
+ if (variable == 10)
+ break;
+ }
+ printf("%d\n", variable);
+ }
+
+
+ /* The argument to "printf" should be a constant, not a variable. */
+ /* { dg-final { scan-tree-dump-times "printf.*, 0" 1 "ccp"} } */
+
+