aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfg.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-09-19 12:29:10 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-09-19 12:29:10 -0700
commit3d9339a9ca5de0b96db7c02b23b0b94656b9e1bf (patch)
tree61b719ef5a4cd481280e9c081860e375a72534fe /gcc/cfg.c
parente2c9fb9bbc6b094cd01b60c196f36d6cccc7bb89 (diff)
downloadgcc-3d9339a9ca5de0b96db7c02b23b0b94656b9e1bf.zip
gcc-3d9339a9ca5de0b96db7c02b23b0b94656b9e1bf.tar.gz
gcc-3d9339a9ca5de0b96db7c02b23b0b94656b9e1bf.tar.bz2
cfg.c (force_nonfallthru_and_redirect): Handle redirecting to the exit block.
* cfg.c (force_nonfallthru_and_redirect): Handle redirecting to the exit block. * Makefile.in (cfg.o): Depend on TM_P_H. From-SVN: r45696
Diffstat (limited to 'gcc/cfg.c')
-rw-r--r--gcc/cfg.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 00645c2..9ba752d 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -64,9 +64,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "function.h"
#include "except.h"
#include "toplev.h"
-
+#include "tm_p.h"
#include "obstack.h"
+
+/* Stubs in case we haven't got a return insn. */
+#ifndef HAVE_return
+#define HAVE_return 0
+#define gen_return() NULL_RTX
+#endif
+
/* The obstack on which the flow graph components are allocated. */
struct obstack flow_obstack;
@@ -1249,7 +1256,6 @@ force_nonfallthru_and_redirect (e, target)
basic_block jump_block, new_bb = NULL;
rtx note;
edge new_edge;
- rtx label;
if (e->flags & EDGE_ABNORMAL)
abort ();
@@ -1290,10 +1296,20 @@ force_nonfallthru_and_redirect (e, target)
else
jump_block = e->src;
e->flags &= ~EDGE_FALLTHRU;
- label = block_label (target);
- emit_jump_insn_after (gen_jump (label), jump_block->end);
- JUMP_LABEL (jump_block->end) = label;
- LABEL_NUSES (label)++;
+ if (target == EXIT_BLOCK_PTR)
+ {
+ if (HAVE_return)
+ emit_jump_insn_after (gen_return (), jump_block->end);
+ else
+ abort ();
+ }
+ else
+ {
+ rtx label = block_label (target);
+ emit_jump_insn_after (gen_jump (label), jump_block->end);
+ JUMP_LABEL (jump_block->end) = label;
+ LABEL_NUSES (label)++;
+ }
emit_barrier_after (jump_block->end);
redirect_edge_succ_nodup (e, target);