This series teaches cfgcleanup how to optimize jumps and branches to and around return statements, after which the shrink-wrap code doesn't have to deal with it anymore. The simplified code also catches a few more cases.
Tested on powerpc64-linux (-m32 and -m64, all languages), and also on x86_64-linux (actually, still in progress with the most recent version of the patchset). Is this okay for trunk? Segher cfgcleanup: Bugfix cfgcleanup: Fold jumps and conditional branches with returns shrink-wrap: Remove complicated simple_return manipulations gcc/cfgcleanup.c | 124 +++++++++++++++++++++++++++++++ gcc/function.c | 213 +----------------------------------------------------- gcc/shrink-wrap.c | 171 ++++--------------------------------------- gcc/shrink-wrap.h | 6 -- 4 files changed, 140 insertions(+), 374 deletions(-) -- 1.9.3