diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2016-05-04 22:50:12 +0200 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2016-05-04 22:50:12 +0200 |
commit | 1a8fb012bda277aa1b4373d2f426986bce76460d (patch) | |
tree | b365f615f8e40e96cefd511c4457912a5b7341e1 /gcc/cfgcleanup.c | |
parent | 2d1ac15a6abfe3cf5cd6ee92a3d8960bd9fb1af8 (diff) |
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
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 6e92d4cdde2..19583a78239 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; |