Commit fe792dd8 by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/79780 (ICE in rtl_verify_bb_insns, at cfgrtl.c:2661…

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
parent 35a4e4ed
2017-03-02 Jakub Jelinek <jakub@redhat.com>
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.
2017-03-02 Richard Biener <rguenther@suse.de> 2017-03-02 Richard Biener <rguenther@suse.de>
* fold-const.c (const_binop): Use ulow () instead of elt (0). * fold-const.c (const_binop): Use ulow () instead of elt (0).
......
...@@ -1852,15 +1852,25 @@ one_cprop_pass (void) ...@@ -1852,15 +1852,25 @@ one_cprop_pass (void)
if (! NOTE_P (insn) && ! insn->deleted ()) if (! NOTE_P (insn) && ! insn->deleted ())
mark_oprs_set (insn); mark_oprs_set (insn);
if (!was_uncond_trap && !seen_uncond_trap if (!was_uncond_trap
&& GET_CODE (PATTERN (insn)) == TRAP_IF && GET_CODE (PATTERN (insn)) == TRAP_IF
&& XEXP (PATTERN (insn), 0) == const1_rtx) && XEXP (PATTERN (insn), 0) == const1_rtx)
{ {
/* 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; seen_uncond_trap = true;
uncond_traps.safe_push (insn); uncond_traps.safe_push (insn);
} }
} }
} }
}
/* Make sure bypass_conditional_jumps will ignore not just its new /* Make sure bypass_conditional_jumps will ignore not just its new
basic blocks, but also the ones after unconditional traps (those are basic blocks, but also the ones after unconditional traps (those are
......
2017-03-02 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/79780
* gcc.c-torture/compile/pr79780.c: New test.
2017-03-02 Richard Biener <rguenther@suse.de> 2017-03-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/79345 PR tree-optimization/79345
......
/* PR rtl-optimization/79780 */
int t3, iy, f4, oi, gn;
void
foo (long long int mh)
{
int pi = 0;
if (iy != 0)
for (;;)
f4 = 0;
if (t3 != 0)
{
while (mh != 0LL)
{
while (mh < 1LL)
++mh;
++mh;
}
for (;;)
;
for (oi = 0; oi < 1; ++oi)
{
n3:;
}
gn = iy = 1;
}
f4 = 0;
if (pi - (mh != 0LL) == 0)
if (mh != 1LL)
{
oi = t3 = 0;
if (mh == 0LL)
++pi;
}
if (iy != 0 && pi != 0)
{
t3 = 0;
goto n3;
}
t3 /= 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment