------- 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