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
- From: Jan Hubicka <jh at suse dot cz>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, jh at suse dot cz, rth at redhat dot com
- Date: Sat, 5 Jul 2003 23:11:03 +0200
- Subject: Re: [PATCH] Fix force_nonfallthru_and_redirect
- References: <20030705093743.GA14013@atrey.karlin.mff.cuni.cz>
> 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?
Honza
>
> Zdenek
>
> * cfgrtl.c (force_nonfallthru_and_redirect): Detect case of dead
> jumptable.
>
> Index: cfgrtl.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
> retrieving revision 1.91
> diff -c -3 -p -r1.91 cfgrtl.c
> *** cfgrtl.c 3 Jul 2003 18:40:27 -0000 1.91
> --- cfgrtl.c 5 Jul 2003 09:34:25 -0000
> *************** force_nonfallthru_and_redirect (edge e,
> *** 1045,1050 ****
> --- 1045,1051 ----
> /* ... and ADDR_VECs. */
> if (note != NULL
> && GET_CODE (note) == CODE_LABEL
> + && LABEL_NUSES (note) != 0
> && NEXT_INSN (note)
> && GET_CODE (NEXT_INSN (note)) == JUMP_INSN
> && (GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_DIFF_VEC