This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][4.1/4.2] Fix PR26672
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dnovillo at redhat dot com
- Date: Tue, 14 Mar 2006 13:32:51 +0100 (CET)
- Subject: [PATCH][4.1/4.2] Fix PR26672
This fixes PR26672 - we were iterating over stmt DEFs before going into
SSA.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
Ok for mainline and 4.1?
Thanks,
Richard.
:ADDPATCH middle-end:
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.
Index: tree-ssa-propagate.c
===================================================================
*** tree-ssa-propagate.c (revision 111993)
--- tree-ssa-propagate.c (working copy)
*************** set_rhs (tree *stmt_p, tree expr)
*** 625,631 ****
*stmt_p = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt ();
(*stmt_p)->common.ann = (tree_ann_t) ann;
! if (TREE_SIDE_EFFECTS (expr))
{
/* Fix all the SSA_NAMEs created by *STMT_P to point to its new
replacement. */
--- 625,632 ----
*stmt_p = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt ();
(*stmt_p)->common.ann = (tree_ann_t) ann;
! if (in_ssa_p
! && TREE_SIDE_EFFECTS (expr))
{
/* Fix all the SSA_NAMEs created by *STMT_P to point to its new
replacement. */
/* { 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";