This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Repair damage after PR 8866 fix
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 18 Apr 2003 15:00:11 -0700
- Subject: PATCH: Repair damage after PR 8866 fix
- Reply-to: mark at codesourcery dot com
This patch fixes the problem David Anglin reported, and, hopefully,
the SCO bootstrap problem as well.
Bootsrapped and tested on i686-pc-linux-gnu, applied on the branch
(and, using the newer version of tablejump_p) on the mainline.
--
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery dot com
2003-04-18 Mark Mitchell <mark at codesourcery dot com>
* cfgrtl.c (try_redirect_by_replacing_jump): Create a basic block
for orphaned jump tables.
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.61.2.8
diff -c -5 -p -r1.61.2.8 cfgrtl.c
*** cfgrtl.c 16 Apr 2003 20:45:27 -0000 1.61.2.8
--- cfgrtl.c 18 Apr 2003 21:47:16 -0000
*************** try_redirect_by_replacing_jump (e, targe
*** 735,745 ****
/* Or replace possibly complicated jump insn by simple jump insn. */
else
{
rtx target_label = block_label (target);
! rtx barrier, tmp;
emit_jump_insn_after (gen_jump (target_label), insn);
JUMP_LABEL (src->end) = target_label;
LABEL_NUSES (target_label)++;
if (rtl_dump_file)
--- 735,745 ----
/* Or replace possibly complicated jump insn by simple jump insn. */
else
{
rtx target_label = block_label (target);
! rtx barrier, label, table, tmp;
emit_jump_insn_after (gen_jump (target_label), insn);
JUMP_LABEL (src->end) = target_label;
LABEL_NUSES (target_label)++;
if (rtl_dump_file)
*************** try_redirect_by_replacing_jump (e, targe
*** 747,756 ****
--- 747,761 ----
INSN_UID (insn), INSN_UID (src->end));
/* Remove the original jump. If INSN is a tablejump, the jump
table will be removed later, if it is no longer needed. */
delete_insn_chain (kill_from, insn);
+
+ if (tablejump_p (insn))
+ create_basic_block (JUMP_LABEL (insn),
+ NEXT_INSN (JUMP_LABEL (insn)),
+ src);
barrier = next_nonnote_insn (src->end);
if (!barrier || GET_CODE (barrier) != BARRIER)
emit_barrier_after (src->end);
}