This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix force_nonfallthru_and_redirect
> > > Hello,
> > >
> > > cfglayout tries to use force_nonfallthru_and_redirect to fix cases when
> > > dead jumptable would emerge on fallthru edge; but
> > > force_nonfallthru_and_redirect contains a special handling of jumptables
> > > that does not check whether it is dead, thus making it useless.
> >
> > Perhaps delete_dead_jumptables call after the cfglayout insn chain is
> > constructed abd before the edges are fixed would solve this in a better
> > way.
> > What I was concerned about was the alive jumptables with no
> > corresponding tablejump.
> > I will try to test the patch. DSo you have some testcase where current
> > code fails?
>
> Hi,
> I've installed the attache dpatch as obvious. it fixes the problem with
> dead jumptables. I will try to figure out what exactly happends to the
> almost dead jumptables (not having jump_insn but still referenced).
OK, this patch should fix the problem. The cod ein
force_nonfallthru-and_redirect is placing the fallthru block after the
jumptable that is correct for VAX tablejumps with fallthru edge.
This is of course not valid for almost dead jumptables.
OK?
Mon Jul 7 02:24:48 CEST 2003 Jan Hubicka <jh@suse.cz>
* cfgrtl.c (force_nonfallthru_and_redirect): Skip jumptables
only when tablejump is present.
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.92
diff -c -3 -p -r1.92 cfgrtl.c
*** cfgrtl.c 5 Jul 2003 15:17:26 -0000 1.92
--- cfgrtl.c 7 Jul 2003 00:24:35 -0000
*************** force_nonfallthru_and_redirect (edge e,
*** 1043,1049 ****
note = NEXT_INSN (note);
/* ... and ADDR_VECs. */
! if (note != NULL
&& GET_CODE (note) == CODE_LABEL
&& NEXT_INSN (note)
&& GET_CODE (NEXT_INSN (note)) == JUMP_INSN
--- 1043,1049 ----
note = NEXT_INSN (note);
/* ... and ADDR_VECs. */
! if (note != NULL && tablejump_p (e->src->end, NULL, NULL)
&& GET_CODE (note) == CODE_LABEL
&& NEXT_INSN (note)
&& GET_CODE (NEXT_INSN (note)) == JUMP_INSN