From 5c119eea4208c29e4bf2af9c245274cbc3f9d0ca Mon Sep 17 00:00:00 2001 From: rguenth Date: Mon, 24 Sep 2018 07:08:24 +0000 Subject: [PATCH] 2018-09-24 Richard Biener PR tree-optimization/63155 * tree-ssa-propagate.c (add_ssa_edge): Avoid adding PHIs to the worklist when the edge of the respective argument isn't executable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264523 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/tree-ssa-propagate.c | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f3664e449f2..5c07395eefd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-09-24 Richard Biener + + PR tree-optimization/63155 + * tree-ssa-propagate.c (add_ssa_edge): Avoid adding PHIs to + the worklist when the edge of the respective argument isn't + executable. + 2018-09-23 Uros Bizjak * config/i386/i386.h (enum reg_class): Rename MASK_REGS to diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index 9f67a9ab111..140b153d5a1 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -168,10 +168,18 @@ add_ssa_edge (tree var) FOR_EACH_IMM_USE_FAST (use_p, iter, var) { gimple *use_stmt = USE_STMT (use_p); + basic_block use_bb = gimple_bb (use_stmt); /* If we did not yet simulate the block wait for this to happen and do not add the stmt to the SSA edge worklist. */ - if (! (gimple_bb (use_stmt)->flags & BB_VISITED)) + if (! (use_bb->flags & BB_VISITED)) + continue; + + /* If this is a use on a not yet executable edge do not bother to + queue it. */ + if (gimple_code (use_stmt) == GIMPLE_PHI + && !(EDGE_PRED (use_bb, PHI_ARG_INDEX_FROM_USE (use_p))->flags + & EDGE_EXECUTABLE)) continue; if (prop_simulate_again_p (use_stmt) -- 2.11.4.GIT