diff options
author | Richard Guenther <rguenther@suse.de> | 2011-03-16 12:41:08 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-03-16 12:41:08 +0000 |
commit | ef13324ecab94740e5bb2f4c65e0600fe616e9ae (patch) | |
tree | 610cae3077906896402d52f6103099ad59a5184d /gcc/tree-ssa-sink.c | |
parent | f0eddb90199eac4df644329c8cd0089b110062f1 (diff) | |
download | gcc-ef13324ecab94740e5bb2f4c65e0600fe616e9ae.tar.gz |
re PR c/48146 (ICE tree check: expected ssa_name, have var_decl in has_zero_uses, at tree-flow-inline.h:342)
2011-03-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/48146
* tree-ssa-sink.c (sink_code_in_bb): Manually update virtual
operands avoiding the need for renaming.
* gcc.dg/torture/pr48146.c: New testcase.
From-SVN: r171045
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r-- | gcc/tree-ssa-sink.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c index c3119ba5a70..4dc5ae44a27 100644 --- a/gcc/tree-ssa-sink.c +++ b/gcc/tree-ssa-sink.c @@ -505,12 +505,18 @@ sink_code_in_bb (basic_block bb) bb->index, (gsi_bb (togsi))->index); } - /* Prepare for VOP update. */ + /* Update virtual operands of statements in the path we + do not sink to. */ if (gimple_vdef (stmt)) { - unlink_stmt_vdef (stmt); - gimple_set_vdef (stmt, gimple_vop (cfun)); - mark_sym_for_renaming (gimple_vop (cfun)); + imm_use_iterator iter; + use_operand_p use_p; + gimple vuse_stmt; + + FOR_EACH_IMM_USE_STMT (vuse_stmt, iter, gimple_vdef (stmt)) + if (gimple_code (vuse_stmt) != GIMPLE_PHI) + FOR_EACH_IMM_USE_ON_STMT (use_p, iter) + SET_USE (use_p, gimple_vuse (stmt)); } /* If this is the end of the basic block, we need to insert at the end |