re PR tree-optimization/26672 (ICE in op_iter_init, triggered by printf->puts optimiz...
authorRichard Guenther <rguenther@suse.de>
Tue, 14 Mar 2006 12:50:10 +0000 (12:50 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 14 Mar 2006 12:50:10 +0000 (12:50 +0000)
2006-03-14  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/26672
* tree-ssa-propagate.c (set_rhs): Don't walk DEFs if not in
SSA form.

* gcc.dg/torture/pr26672.c: New testcase.

From-SVN: r112050

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr26672.c [new file with mode: 0644]
gcc/tree-ssa-propagate.c

index 63d589b..813e37d 100644 (file)
@@ -1,5 +1,11 @@
 2006-03-14  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimization/26672
+       * tree-ssa-propagate.c (set_rhs): Don't walk DEFs if not in
+       SSA form.
+
+2006-03-14  Richard Guenther  <rguenther@suse.de>
+
        PR tree-optimization/26667
        * ipa-inline.c (cgraph_check_inline_limits): Walk the correct
        node for the callees.  Always allow inlining if it will shrink
index 5d89feb..e955f5e 100644 (file)
@@ -1,3 +1,8 @@
+2006-03-14  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/26672
+       * gcc.dg/torture/pr26672.c: New testcase.
+
 2006-03-14  Joseph S. Myers  <joseph@codesourcery.com>
 
        * gcc.target/powerpc/405-dlmzb-strlen-1.c,
diff --git a/gcc/testsuite/gcc.dg/torture/pr26672.c b/gcc/testsuite/gcc.dg/torture/pr26672.c
new file mode 100644 (file)
index 0000000..b13b5dc
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+int printf(const char *format, ...);
+extern const char help_string[];
+void app_opts(void) {
+    printf("%s", help_string);
+}
+const char help_string[] = "foo\n";
index dcdc6ad..00d5a94 100644 (file)
@@ -632,7 +632,8 @@ set_rhs (tree *stmt_p, tree expr)
       *stmt_p = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt ();
       (*stmt_p)->common.ann = (tree_ann_t) ann;
 
-      if (TREE_SIDE_EFFECTS (expr))
+      if (in_ssa_p
+         && TREE_SIDE_EFFECTS (expr))
        {
          /* Fix all the SSA_NAMEs created by *STMT_P to point to its new
             replacement.  */