diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2016-05-04 22:54:47 +0200 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2016-05-04 22:54:47 +0200 |
commit | 45676a7c8a09579a591fb8d20db90df92a1713b3 (patch) | |
tree | 0b0bd030c7648340a035bf394fa67488d6f390a9 /COPYING3.LIB | |
parent | 1a8fb012bda277aa1b4373d2f426986bce76460d (diff) | |
download | gcc-45676a7c8a09579a591fb8d20db90df92a1713b3.zip gcc-45676a7c8a09579a591fb8d20db90df92a1713b3.tar.gz gcc-45676a7c8a09579a591fb8d20db90df92a1713b3.tar.bz2 |
cfgcleanup: Fold jumps and conditional branches with returns
This patch makes cfgcleanup optimize jumps to returns. There are three
cases this handles:
-- A jump to a return; this is simplified to just that return.
-- A conditional branch to a return; simplified to a conditional return.
-- A conditional branch that falls through to a return. This is simplified
to a conditional return (with the condition inverted), falling through
to a jump to the original destination. That jump can then be optimized
further, as usual.
This handles all cases the current function.c does, and a few it misses.
* cfgcleanup.c (bb_is_just_return): New function.
(try_optimize_cfg): Simplify jumps to return, branches to return,
and branches around return.
From-SVN: r235904
Diffstat (limited to 'COPYING3.LIB')
0 files changed, 0 insertions, 0 deletions