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 test


This is a testcase for the tree-ssa-dom bug I just fixed.

        * gcc.dg/tree-ssa/20040209-2.c: New test.
Index: gcc.dg/tree-ssa/20040209-1.c
===================================================================
RCS file: gcc.dg/tree-ssa/20040209-1.c
diff -N gcc.dg/tree-ssa/20040209-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc.dg/tree-ssa/20040209-1.c	9 Feb 2004 17:48:46 -0000
***************
*** 0 ****
--- 1,52 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O2 -Wuninitialized" } */
+ 
+ typedef union tree_node *tree;
+ 
+ struct tree_common
+ {
+   tree chain;
+ };
+ 
+ struct tree_decl
+ {
+   struct tree_common common;
+   tree name;
+ };
+ 
+ 
+ union tree_node
+ {
+   struct tree_common common;
+   struct tree_decl decl;
+ };
+ 
+ int pedantic;
+ 
+ void
+ finish_struct (tree t, tree fieldlist, tree attributes)
+ {
+   union tree_node * x;
+ 
+   if (pedantic)
+     {
+       x = fieldlist;
+       if (x->decl.name == 0)
+ 	{
+ 	  while (x)
+ 	    x = x->common.chain;
+ 	  foo (fieldlist);
+ 	}
+     }
+ 
+   x = fieldlist;
+   if (x)
+     {
+       do
+ 	{
+ 	  x = x->common.chain;
+ 	} while (x != 0);
+     }
+   
+   bar1 (&fieldlist);
+ }



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