aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-07-15 12:48:47 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-07-15 12:48:47 +0000
commit5e79b147663c2f24079f3292e25cd66693da8cf5 (patch)
treee5028f68e7dc374635a75bfb45a2d367fbac4d8b /gcc/tree-cfg.c
parent6c2833e74e4e64a71bafaf6e20e65506bbce5a5c (diff)
downloadgcc-5e79b147663c2f24079f3292e25cd66693da8cf5.zip
gcc-5e79b147663c2f24079f3292e25cd66693da8cf5.tar.gz
gcc-5e79b147663c2f24079f3292e25cd66693da8cf5.tar.bz2
re PR tree-optimization/91162 (ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:86 (error: invalid 'PHI' argument))
2019-07-15 Richard Biener <rguenther@suse.de> PR middle-end/91162 * tree-cfg.c (move_block_to_fn): When releasing a virtual PHI node make sure to replace all uses with something valid. * gcc.dg/autopar/pr91162.c: New testcase. From-SVN: r273492
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 5c67d02..4521fe3 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -7088,7 +7088,14 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb,
if (virtual_operand_p (op))
{
/* Remove the phi nodes for virtual operands (alias analysis will be
- run for the new function, anyway). */
+ run for the new function, anyway). But replace all uses that
+ might be outside of the region we move. */
+ use_operand_p use_p;
+ imm_use_iterator iter;
+ gimple *use_stmt;
+ FOR_EACH_IMM_USE_STMT (use_stmt, iter, op)
+ FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+ SET_USE (use_p, SSA_NAME_VAR (op));
remove_phi_node (&psi, true);
continue;
}