From: Richard Biener Date: Mon, 15 Jul 2019 12:48:47 +0000 (+0000) Subject: re PR tree-optimization/91162 (ICE: tree check: expected class 'type', have 'exceptio... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e79b147663c2f24079f3292e25cd66693da8cf5;p=gcc.git 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 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1ff1c4c7fcd..af0b4b5e165 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-07-15 Richard Biener + + 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. + 2019-07-15 Kewen Lin PR tree-optimization/88497 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 57d11413f5a..d36652f91e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-07-15 Richard Biener + + PR middle-end/91162 + * gcc.dg/autopar/pr91162.c: New testcase. + 2019-07-15 Kewen Lin PR tree-optimization/88497 diff --git a/gcc/testsuite/gcc.dg/autopar/pr91162.c b/gcc/testsuite/gcc.dg/autopar/pr91162.c new file mode 100644 index 00000000000..4bfedb908e5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/autopar/pr91162.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-parallelize-loops=2 -fno-tree-dominator-opts --param parloops-min-per-thread=30" } */ + +void +zf (__int128 ct) +{ + __int128 *rk = &ct; + + if (0) + { + int jj; + +t9: + for (jj = 0; jj < 60; ++jj) + { + } + + __builtin_unreachable (); + } + + while (*rk < 1) + ++*rk; + + goto t9; +} diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 5c67d024608..4521fe347dc 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; }