From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15910 invoked by alias); 16 Jan 2002 04:23:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 15774 invoked from network); 16 Jan 2002 04:22:57 -0000 Received: from unknown (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sources.redhat.com with SMTP; 16 Jan 2002 04:22:57 -0000 Received: from hiauly1.hia.nrc.ca (localhost [127.0.0.1]) by hiauly1.hia.nrc.ca (8.12.0.Beta16/8.12.0.Beta16) with ESMTP id g0G4MtFN027597; Tue, 15 Jan 2002 23:22:56 -0500 (EST) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.12.0.Beta16/8.12.0.Beta16) id g0G4MsTt027596; Tue, 15 Jan 2002 23:22:54 -0500 (EST) Message-Id: <200201160422.g0G4MsTt027596@hiauly1.hia.nrc.ca> Subject: Re: PATCH: Re: ICE in 920624-1.c with -O3 -funroll-loops on vax-dec-ultrix4.3 To: rth@redhat.com (Richard Henderson) Date: Tue, 15 Jan 2002 20:27:00 -0000 From: "John David Anglin" Cc: gcc-bugs@gcc.gnu.org, jh@suse.cz, gcc-patches@gcc.gnu.org In-Reply-To: <20020115190555.A10909@redhat.com> from "Richard Henderson" at Jan 15, 2002 07:05:55 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg01137.txt.bz2 > On Tue, Jan 15, 2002 at 06:16:14PM -0500, John David Anglin wrote: > > This patch fixes the problem by deleting the jump table data when a > > conditional or computed jump is converted to an unconditional jump. > > I have verified that the patch fixes the original problem observed > > under vax-dec-ultrix4.3. A new vax bootstrap is underway but it > > won't finish until sometime next month. > > This is extremely delicate. It is not uncommon for there to > be references remaining to the jump table that won't be deleted > until later dead code elimination. > > I'm therefore uncomfortable with simply removing it like this. > I'm not sure what to suggest as an alternative though... I suspect the problem is specific to the VAX. The VAX is the only port that defines CASE_DROPS_THROUGH. When the VAX casesi jump is folded, the PC's value in the casesi insn is replaced by a LABEL_REF pointing to the CODE_LABEL before the jump table which unfortunately is in the current block. Then, at a later point, the barrier is added in cse_insn creating the invalid configuration. I tried moving delete_trivially_dead_insns up before cleanup_cfg in toplev.c but that didn't remove the jump table. I tried removing the jump insn. That failed at a different point in verify_flow_info. It might be possible to make that approach work but I suspect that you would have the same misgivings. I could wrap the code to delete the jump table in an #ifdef CASE_DROPS_THROUGH if that would make you more comfortable. The other options that I can see are: changing verify_flow_info to allow the barrier in this situation if CASE_DROPS_THROUGH, or not emitting the barrier in cse_main. As an aside, I noticed that gcc can't simplify a switch statement when its expression evaluates to a value in the range of the switch. This is because a MEM is used to access the jump table. Probably not a big deal, but the HP compiler can do it. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605)