This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] New test
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 09 Feb 2004 10:49:05 -0700
- Subject: [tree-ssa] New test
- Reply-to: law at redhat dot com
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);
+ }