diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-03-02 17:02:37 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-03-02 17:02:37 +0100 |
commit | fe792dd82ff149208e9c7df2fab241aeda78afe3 (patch) | |
tree | 036c24db59cfd5f9166e68ab892452c1abf3df5d /gcc/cprop.c | |
parent | 35a4e4ed81d9aae4bbd29cf24e389269d08f1fc2 (diff) | |
download | gcc-fe792dd82ff149208e9c7df2fab241aeda78afe3.zip gcc-fe792dd82ff149208e9c7df2fab241aeda78afe3.tar.gz gcc-fe792dd82ff149208e9c7df2fab241aeda78afe3.tar.bz2 |
re PR rtl-optimization/79780 (ICE in rtl_verify_bb_insns, at cfgrtl.c:2661 (error: flow control insn inside a basic block))
PR rtl-optimization/79780
* cprop.c (one_cprop_pass): When second and further conditional trap
in a single basic block is turned into an unconditional trap, turn it
into a deleted note to avoid RTL verification failures.
* gcc.c-torture/compile/pr79780.c: New test.
From-SVN: r245843
Diffstat (limited to 'gcc/cprop.c')
-rw-r--r-- | gcc/cprop.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/cprop.c b/gcc/cprop.c index 7d20c44..4814b5e 100644 --- a/gcc/cprop.c +++ b/gcc/cprop.c @@ -1852,12 +1852,22 @@ one_cprop_pass (void) if (! NOTE_P (insn) && ! insn->deleted ()) mark_oprs_set (insn); - if (!was_uncond_trap && !seen_uncond_trap + if (!was_uncond_trap && GET_CODE (PATTERN (insn)) == TRAP_IF && XEXP (PATTERN (insn), 0) == const1_rtx) { - seen_uncond_trap = true; - uncond_traps.safe_push (insn); + /* If we have already seen an unconditional trap + earlier, the rest of the bb is going to be removed + as unreachable. Just turn it into a note, so that + RTL verification doesn't complain about it before + it is finally removed. */ + if (seen_uncond_trap) + set_insn_deleted (insn); + else + { + seen_uncond_trap = true; + uncond_traps.safe_push (insn); + } } } } |