* jump.c (tablejump_p): New.
* cfgcleanup.c (try_optimize_cfg): Do not merge blocks across tablejump.
* rtl.h (tablejump_p): Declare.
From-SVN: r59149
+Sat Nov 16 02:54:29 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * jump.c (tablejump_p): New.
+ * cfgcleanup.c (try_optimize_cfg): Do not merge blocks across tablejump.
+ * rtl.h (tablejump_p): Declare.
+
2002-11-16 Graham Stott <graham.stott@btinternet.com>
* flow.c (life_analysis): Update LABEL_NUSES before purging
/* If the jump insn has side effects,
we can't kill the edge. */
&& (GET_CODE (b->end) != JUMP_INSN
- || onlyjump_p (b->end))
+ || (onlyjump_p (b->end)
+ && !tablejump_p (b->end)))
&& merge_blocks (s, b, c, mode))
changed_here = true;
&& GET_CODE (SET_DEST (PATTERN (insn))) == PC
&& GET_CODE (SET_SRC (PATTERN (insn))) == LABEL_REF);
}
+/* Return 1 if INSN is an tablejump. */
+
+int
+tablejump_p (insn)
+ rtx insn;
+{
+ rtx table;
+ return (GET_CODE (insn) == JUMP_INSN
+ && JUMP_LABEL (insn)
+ && NEXT_INSN (JUMP_LABEL (insn))
+ && (table = next_active_insn (JUMP_LABEL (insn)))
+ && GET_CODE (table) == JUMP_INSN
+ && (GET_CODE (PATTERN (table)) == ADDR_VEC
+ || GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC));
+}
/* Return nonzero if INSN is a (possibly) conditional jump
and nothing more.
extern rtx condjump_label PARAMS ((rtx));
extern int simplejump_p PARAMS ((rtx));
extern int returnjump_p PARAMS ((rtx));
+extern int tablejump_p PARAMS ((rtx));
extern int onlyjump_p PARAMS ((rtx));
extern int only_sets_cc0_p PARAMS ((rtx));
extern int sets_cc0_p PARAMS ((rtx));