middle-end/8502: [3.2 regression] wrong code generated for switch statement
Richard Henderson
rth@redhat.com
Thu Mar 27 22:36:00 GMT 2003
The following reply was made to PR middle-end/8502; it has been noted by GNATS.
From: Richard Henderson <rth@redhat.com>
To: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, rveldema@cs.vu.nl,
gcc-patches@gcc.gnu.org
Subject: Re: middle-end/8502: [3.2 regression] wrong code generated for switch statement
Date: Thu, 27 Mar 2003 14:28:07 -0800
On Tue, Mar 25, 2003 at 02:05:43PM +0100, Volker Reichelt wrote:
> I strongly suspect your patch
>
> http://gcc.gnu.org/ml/gcc-cvs/2003-03/msg01201.html
>
> is responsible for the new failure of this PR because it modifies
> cfgrtl.c where the original failure was fixed.
Blah. Test case broke again only at -O0. Fixed thus.
r~
* cfgrtl.c (try_redirect_by_replacing_jump): Disable removing
tablejumps with no optimization.
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.29.2.6.2.2
diff -c -p -d -u -r1.29.2.6.2.2 cfgrtl.c
--- cfgrtl.c 23 Mar 2003 20:41:22 -0000 1.29.2.6.2.2
+++ cfgrtl.c 27 Mar 2003 22:23:00 -0000
@@ -665,7 +665,6 @@ try_redirect_by_replacing_jump (e, targe
edge tmp;
rtx set;
int fallthru = 0;
- rtx table;
/* Verify that all targets will be TARGET. */
for (tmp = src->succ; tmp; tmp = tmp->succ_next)
@@ -675,11 +674,7 @@ try_redirect_by_replacing_jump (e, targe
if (tmp || !onlyjump_p (insn))
return false;
- if (flow2_completed && JUMP_LABEL (insn)
- && (table = NEXT_INSN (JUMP_LABEL (insn))) != NULL_RTX
- && GET_CODE (table) == JUMP_INSN
- && (GET_CODE (PATTERN (table)) == ADDR_VEC
- || GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC))
+ if ((!optimize || flow2_completed) && tablejump_p (insn))
return false;
/* Avoid removing branch with side effects. */
More information about the Gcc-prs
mailing list