diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-09 11:54:32 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-09 11:54:32 +0000 |
commit | fa30068d3f9f56bcd98ccba845ae84f6b8110e0d (patch) | |
tree | 1266db03a7c5be51f082e7ae4130491500777996 /gcc/tree-ssa-propagate.c | |
parent | da48fb101e2d50af2e4c9ca609bc07a3e0b2e924 (diff) | |
download | gcc-fa30068d3f9f56bcd98ccba845ae84f6b8110e0d.tar.gz |
PR middle-end/46360
* tree-ssa-propagate.c (update_call_from_tree): Fix for use
not in SSA mode.
* gcc.c-torture/compile/pr46360.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166482 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r-- | gcc/tree-ssa-propagate.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index c97960cfdf7..7f1d84ebdfe 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -760,8 +760,11 @@ update_call_from_tree (gimple_stmt_iterator *si_p, tree expr) /* No value is expected, and EXPR has no effect. Replace it with an empty statement. */ new_stmt = gimple_build_nop (); - unlink_stmt_vdef (stmt); - release_defs (stmt); + if (gimple_in_ssa_p (cfun)) + { + unlink_stmt_vdef (stmt); + release_defs (stmt); + } } else { @@ -773,7 +776,8 @@ update_call_from_tree (gimple_stmt_iterator *si_p, tree expr) lhs = create_tmp_var (TREE_TYPE (expr), NULL); new_stmt = gimple_build_assign (lhs, expr); add_referenced_var (lhs); - lhs = make_ssa_name (lhs, new_stmt); + if (gimple_in_ssa_p (cfun)) + lhs = make_ssa_name (lhs, new_stmt); gimple_assign_set_lhs (new_stmt, lhs); gimple_set_vuse (new_stmt, gimple_vuse (stmt)); gimple_set_vdef (new_stmt, gimple_vdef (stmt)); |