From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19310 invoked by alias); 27 Mar 2003 22:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 19280 invoked by uid 71); 27 Mar 2003 22:36:00 -0000 Date: Thu, 27 Mar 2003 22:36:00 -0000 Message-ID: <20030327223600.19279.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Richard Henderson Subject: Re: middle-end/8502: [3.2 regression] wrong code generated for switch statement Reply-To: Richard Henderson X-SW-Source: 2003-03/txt/msg01952.txt.bz2 List-Id: The following reply was made to PR middle-end/8502; it has been noted by GNATS. From: Richard Henderson To: Volker Reichelt 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. */