Message ID | 2a60ce46242613cda251f7f323e84aa6027d757c.1462256245.git.segher@kernel.crashing.org |
---|---|
State | New |
Headers | show |
On Tue, May 3, 2016 at 8:59 AM, Segher Boessenkool wrote: > If the jump_block here contains just a return, we will crash later > in invert_jump. Don't allow that case. But if jump_block contains a return, then it isn't the EXIT_BLOCK for the function. Is the conditional jump a conditional return insn? Ciao! Steven
On Tue, May 03, 2016 at 10:28:37PM +0200, Steven Bosscher wrote: > On Tue, May 3, 2016 at 8:59 AM, Segher Boessenkool wrote: > > If the jump_block here contains just a return, we will crash later > > in invert_jump. Don't allow that case. > > But if jump_block contains a return, then it isn't the EXIT_BLOCK for > the function. The single successor block of the jump block is the exit block. Too many blocks here ;-) Segher
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 6e92d4c..19583a7 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -156,6 +156,7 @@ try_simplify_condjump (basic_block cbranch_block) cbranch_dest_block = cbranch_jump_edge->dest; if (cbranch_dest_block == EXIT_BLOCK_PTR_FOR_FN (cfun) + || jump_dest_block == EXIT_BLOCK_PTR_FOR_FN (cfun) || !can_fallthru (jump_block, cbranch_dest_block)) return false;