aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-01-21 16:15:40 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-01-21 16:15:40 +0100
commit3ffe07e16cbba3f690198801696ec4251700903a (patch)
tree7e0bdfc118ad184dc374b008a10de7c5da9344bc /gcc/tree-eh.c
parent1c7d0b34dcb5810c6da08a672af1ab7d1499fe1b (diff)
downloadgcc-3ffe07e16cbba3f690198801696ec4251700903a.zip
gcc-3ffe07e16cbba3f690198801696ec4251700903a.tar.gz
gcc-3ffe07e16cbba3f690198801696ec4251700903a.tar.bz2
re PR tree-optimization/47355 (ICE: verify_ssa failed with -O2 -fipa-cp-clone)
PR tree-optimization/47355 * tree-eh.c (cleanup_empty_eh_merge_phis): Give up if NOP has non-debug uses beyond PHIs in new_bb. * g++.dg/opt/pr47355.C: New test. From-SVN: r169094
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 65d0ff2..f189b9b 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3552,6 +3552,20 @@ cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb,
/* If we did find the corresponding PHI, copy those inputs. */
if (ophi)
{
+ /* If NOP is used somewhere else beyond phis in new_bb, give up. */
+ if (!has_single_use (nop))
+ {
+ imm_use_iterator imm_iter;
+ use_operand_p use_p;
+
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, nop)
+ {
+ if (!gimple_debug_bind_p (USE_STMT (use_p))
+ && (gimple_code (USE_STMT (use_p)) != GIMPLE_PHI
+ || gimple_bb (USE_STMT (use_p)) != new_bb))
+ goto fail;
+ }
+ }
bitmap_set_bit (ophi_handled, SSA_NAME_VERSION (nop));
FOR_EACH_EDGE (e, ei, old_bb->preds)
{