diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 63d589b0e7b8..813e37d69545 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-03-14 Richard Guenther + + PR tree-optimization/26672 + * tree-ssa-propagate.c (set_rhs): Don't walk DEFs if not in + SSA form. + 2006-03-14 Richard Guenther PR tree-optimization/26667 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5d89febca76e..e955f5ef9ddf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-03-14 Richard Guenther + + PR tree-optimization/26672 + * gcc.dg/torture/pr26672.c: New testcase. + 2006-03-14 Joseph S. Myers * 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 index 000000000000..b13b5dcaef7a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr26672.c @@ -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"; diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index dcdc6add4dd2..00d5a9458896 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -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. */