aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-02-15 13:22:56 -0800
committerRichard Henderson <rth@gcc.gnu.org>2003-02-15 13:22:56 -0800
commit99dc72775ffa084451dfc05947102ea2f176e25e (patch)
tree33f670d96dd4073de4b68f4ac4f97dfe221c8034 /gcc/stmt.c
parentb54cf83ae659949de888bb3ec2797b7858e6ee1a (diff)
downloadgcc-99dc72775ffa084451dfc05947102ea2f176e25e.zip
gcc-99dc72775ffa084451dfc05947102ea2f176e25e.tar.gz
gcc-99dc72775ffa084451dfc05947102ea2f176e25e.tar.bz2
bb-reorder.c (find_traces_1_round): Don't connect easy to copy successors with multiple predecessors.
* bb-reorder.c (find_traces_1_round): Don't connect easy to copy successors with multiple predecessors. (connect_traces): Try harder to copy traces of length 1. * function.h (struct function): Add computed_goto_common_label, computed_goto_common_reg. * function.c (free_after_compilation): Zap them. * stmt.c (expand_computed_goto): Use them to produce one indirect branch per function. From-SVN: r62944
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index f968012..bc7cc28 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -539,10 +539,23 @@ expand_computed_goto (exp)
#endif
emit_queue ();
- do_pending_stack_adjust ();
- emit_indirect_jump (x);
- current_function_has_computed_jump = 1;
+ if (! cfun->computed_goto_common_label)
+ {
+ cfun->computed_goto_common_reg = copy_to_mode_reg (Pmode, x);
+ cfun->computed_goto_common_label = gen_label_rtx ();
+ emit_label (cfun->computed_goto_common_label);
+
+ do_pending_stack_adjust ();
+ emit_indirect_jump (cfun->computed_goto_common_reg);
+
+ current_function_has_computed_jump = 1;
+ }
+ else
+ {
+ emit_move_insn (cfun->computed_goto_common_reg, x);
+ emit_jump (cfun->computed_goto_common_label);
+ }
}
/* Handle goto statements and the labels that they can go to. */