aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite-scop-detection.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-09-20 07:33:58 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-09-20 07:33:58 +0000
commit73fe2f3229f1e1be902ffd09c42b444e5af9e7f5 (patch)
treed035963e8f29c9b4a3386adeb437f06df9421361 /gcc/graphite-scop-detection.c
parentac9c032e4d7e6350c529707cedda7250b77190cc (diff)
downloadgcc-73fe2f3229f1e1be902ffd09c42b444e5af9e7f5.zip
gcc-73fe2f3229f1e1be902ffd09c42b444e5af9e7f5.tar.gz
gcc-73fe2f3229f1e1be902ffd09c42b444e5af9e7f5.tar.bz2
re PR tree-optimization/81373 (Graphite ICE in ssa_default_def at gcc/tree-dfa.c:305)
2017-09-20 Richard Biener <rguenther@suse.de> PR tree-optimization/81373 * graphite-scop-detection.c (build_cross_bb_scalars_def): Force SESE live-out defs to be handled even if they are scev_analyzable_p. * gcc.dg/graphite/pr81373.c: New testcase. From-SVN: r253000
Diffstat (limited to 'gcc/graphite-scop-detection.c')
-rw-r--r--gcc/graphite-scop-detection.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 3ed6afd..6fe375e 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -1717,17 +1717,20 @@ build_cross_bb_scalars_def (scop_p scop, tree def, basic_block def_bb,
if (!def || !is_gimple_reg (def))
return;
- /* Do not gather scalar variables that can be analyzed by SCEV as they can be
- generated out of the induction variables. */
- if (scev_analyzable_p (def, scop->scop_info->region))
- return;
+ bool scev_analyzable = scev_analyzable_p (def, scop->scop_info->region);
gimple *use_stmt;
imm_use_iterator imm_iter;
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
- if ((def_bb != gimple_bb (use_stmt) && !is_gimple_debug (use_stmt))
- /* PHIs have their effect at "BBs" on the edges. See PR79622. */
- || gimple_code (SSA_NAME_DEF_STMT (def)) == GIMPLE_PHI)
+ /* Do not gather scalar variables that can be analyzed by SCEV as they can
+ be generated out of the induction variables. */
+ if ((! scev_analyzable
+ /* But gather SESE liveouts as we otherwise fail to rewrite their
+ exit PHIs. */
+ || ! bb_in_sese_p (gimple_bb (use_stmt), scop->scop_info->region))
+ && ((def_bb != gimple_bb (use_stmt) && !is_gimple_debug (use_stmt))
+ /* PHIs have their effect at "BBs" on the edges. See PR79622. */
+ || gimple_code (SSA_NAME_DEF_STMT (def)) == GIMPLE_PHI))
{
writes->safe_push (def);
DEBUG_PRINT (dp << "Adding scalar write: ";