This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] New optimization test


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"} } */
+   
+ 






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]