This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Problem: delete_dead_jumptables and constant pool references
- To: rth at redhat dot com
- Subject: Re: Problem: delete_dead_jumptables and constant pool references
- From: Ulrich Weigand <weigand at immd1 dot informatik dot uni-erlangen dot de>
- Date: Mon, 24 Sep 2001 16:14:36 +0200 (MET DST)
- Cc: uweigand at de dot ibm dot com, hpenner at de dot ibm dot com, gcc-patches at gcc dot gnu dot org
I wrote:
> Richard Henderson wrote:
> > On Fri, Sep 21, 2001 at 12:14:44AM +0200, Ulrich Weigand wrote:
> > > Sorry for the late reply; I finally got around to try this out.
> > > The patch below, implementing your suggestion, does indeed fix
> > > the problem I'm experiencing as well.
> >
> > It's so late that it will be incorrect by tomorrow. Jan has
> > a patch to change the behaviour of flow_delete_insn.
>
> Oops, I didn't realize this patch was related. Thanks for pointing
> this out; I'll redo the patch once Jan's is in ...
OK, after Jan's changes the only problem in delete_dead_jumptables
is the comparison of LABEL_NUSES against 0. This fails if the
jumptable label was forced into the literal pool. The following
patch fixed this by checking LABEL_NUSES against 1 if
LABEL_PRESERVE_P is true, similar to what is done in
propagate_block_delete_insn.
OK to apply?
ChangeLog:
* flow.c (delete_dead_jumptables): Delete jumptable if
the only reference is from the literal pool.
Index: gcc/flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.479
diff -c -p -r1.479 flow.c
*** flow.c 2001/09/21 12:55:13 1.479
--- flow.c 2001/09/24 13:59:54
*************** delete_dead_jumptables ()
*** 795,801 ****
{
next = NEXT_INSN (insn);
if (GET_CODE (insn) == CODE_LABEL
! && LABEL_NUSES (insn) == 0
&& GET_CODE (next) == JUMP_INSN
&& (GET_CODE (PATTERN (next)) == ADDR_VEC
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
--- 795,801 ----
{
next = NEXT_INSN (insn);
if (GET_CODE (insn) == CODE_LABEL
! && LABEL_NUSES (insn) == LABEL_PRESERVE_P (insn)
&& GET_CODE (next) == JUMP_INSN
&& (GET_CODE (PATTERN (next)) == ADDR_VEC
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de