This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] build_insn_list and jump tables
- To: gcc-patches at gcc dot gnu dot org
- Subject: [patch] build_insn_list and jump tables
- From: DJ Delorie <dj at redhat dot com>
- Date: Thu, 1 Mar 2001 00:45:37 -0500
This fixes gcc.c-torture/compile/990801-1.c for m68k. OK to apply?
2001-03-01 DJ Delorie <dj@redhat.com>
* global.c (JUMP_TABLE_P): Define; true if insn is just a jump
table.
(build_insn_chain): When verifying that the last basic block
contains the last real insn, don't consider jump tables to be real
insns.
Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.65
diff -p -3 -r1.65 global.c
*** global.c 2000/12/05 19:12:19 1.65
--- global.c 2001/03/01 05:44:11
*************** reg_dies (regno, mode, chain)
*** 1758,1763 ****
--- 1758,1767 ----
}
}
+ #define JUMP_TABLE_P(insn) (GET_CODE (insn) == JUMP_INSN \
+ && (GET_CODE (PATTERN (insn)) == ADDR_VEC \
+ || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC))
+
/* Walk the insns of the current function and build reload_insn_chain,
and record register life information. */
void
*************** build_insn_chain (first)
*** 1848,1854 ****
if (b == n_basic_blocks)
{
for (first = NEXT_INSN (first) ; first; first = NEXT_INSN (first))
! if (INSN_P (first) && GET_CODE (PATTERN (first)) != USE)
abort ();
break;
}
--- 1852,1860 ----
if (b == n_basic_blocks)
{
for (first = NEXT_INSN (first) ; first; first = NEXT_INSN (first))
! if (INSN_P (first)
! && GET_CODE (PATTERN (first)) != USE
! && ! JUMP_TABLE_P (first))
abort ();
break;
}