aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2005-02-01 10:03:15 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-02-01 10:03:15 +0000
commitbbcb0c056be0883aa970eb5552bb713d516d9c1e (patch)
tree87553ed6cbe3253976ee763b34f7a58ef2a27ed1 /gcc/cfgcleanup.c
parente88334a68f98bc5ca30180787f9c67512b568ab7 (diff)
downloadgcc-bbcb0c056be0883aa970eb5552bb713d516d9c1e.zip
gcc-bbcb0c056be0883aa970eb5552bb713d516d9c1e.tar.gz
gcc-bbcb0c056be0883aa970eb5552bb713d516d9c1e.tar.bz2
re PR rtl-optimization/15242 (pessimization of "goto *")
PR optimization/15242 * params.def (PARAM_MAX_GOTO_DUPLICATION_INSNS): New param. * basic-block.h (duplicate_computed_gotos): Add prototype. * bb-reorder.c (duplicate_computed_gotos): New function to duplicate sufficiently small blocks ending in a computed jump. * passes.c (rest_of_compilation): Call duplicate_computed_gotos if not optimizing for size. * cfgcleanup.c (try_crossjump_bb): If not optimizing for size, never do tail merging for blocks ending in a computed jump. * doc/invoke.texi: Document the max-goto-duplication-insns param. From-SVN: r94531
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 1cb3f2e..3d04a55 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1707,6 +1707,13 @@ try_crossjump_bb (int mode, basic_block bb)
if (EDGE_COUNT (bb->preds) < 2)
return false;
+ /* Don't crossjump if this block ends in a computed jump,
+ unless we are optimizing for size. */
+ if (!optimize_size
+ && bb != EXIT_BLOCK_PTR
+ && computed_jump_p (BB_END (bb)))
+ return false;
+
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
and cold sections.