From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29573 invoked by alias); 12 Mar 2007 20:06:37 -0000 Received: (qmail 29542 invoked by alias); 12 Mar 2007 20:06:26 -0000 Date: Mon, 12 Mar 2007 20:06:00 -0000 Message-ID: <20070312200626.29541.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/30984] [4.1/4.2/4.3 Regression] ICE with computed goto and constants In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "law at redhat dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg01112.txt.bz2 ------- Comment #3 from law at redhat dot com 2007-03-12 20:06 ------- Subject: Re: [4.1/4.2/4.3 Regression] ICE with computed goto and constants On Mon, 2007-03-12 at 19:45 +0000, janis at gcc dot gnu dot org wrote: > > ------- Comment #2 from janis at gcc dot gnu dot org 2007-03-12 19:45 ------- > A regression hunt on powerpc-linux using the submitter's test case identified > this patch: > > http://gcc.gnu.org/viewcvs?view=rev&rev=96084 > > r96084 | law | 2005-03-08 03:39:19 +0000 (Tue, 08 Mar 2005) Thanks for alerting me to this problem. I think the right fix is going to simply be to enforce a rule that we can only optimize a computed goto if the argument collapses down to a local LABEL_REF rather than a generic invariant. In the case where we have a constant or non-local LABEL_REF, the CFG (before optimizing) ought to be conservatively correct(*). Optimizing is impossible because we don't know which outgoing edge to keep and which ones to throw away. This ought to be a 1-2 line fix. Jeff (*) If the argument referred to a constant address in the current function which does not correspond to any known addressable LABEL_REF then we're hosed as the original unoptimized CFG is probably bogus. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30984