Commit 1a8fb012 by Segher Boessenkool Committed by Segher Boessenkool

cfgcleanup: Bugfix in try_simplify_condjump

If the jump_block here contains just a return, we will crash later
in invert_jump.  Don't allow that case.


	* cfgcleanup.c (try_simplify_condjump): Don't try to simplify a
	branch to a return.

From-SVN: r235903
parent 2d1ac15a
2016-05-04 Segher Boessenkool <segher@kernel.crashing.org>
* cfgcleanup.c (try_simplify_condjump): Don't try to simplify a
branch to a return.
2016-05-04 Jakub Jelinek <jakub@redhat.com>
PR c++/70906
......
......@@ -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;
......
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