[patch] Don't change the types for switch statements

Jeffrey A Law law@redhat.com
Thu Mar 10 05:30:00 GMT 2005


On Wed, 2005-03-09 at 23:46 -0500, James A. Morrison wrote:
>  Hi,
> 
>   This patch fixes the latent bug exposed by my fix to pr15784.  index_type
> was being unconditionally set to integer_type_node when try_casesi failed.
> Unfortunatly, not all the tree's being used in the switch statements were
> integer_type_nodes.  This fixes the problem, by not changing index_type.
> Not too long ago index_type was changed after try_casesi to a value stored
> in a case specific datastructure, but that was removed last year.  See
> cvs diff -up -r1.377 -r1.378 stmt.c for more details on that change.
> 
>   I'm bootstrapping this patch on ia64-linux with the patch to pr15784 and
> Ada.  So far the bootstrap has got passed the ice in c-pragma.c or any of
> the Ada code that triggered the problem.  I'm also bootstrapping this patch
> on sparc-linux.  Ok for mainline and regtesting if bootstrap succeeds on
> both ia64 (with pr15784 patch*) and sparc (without 15784) patch?
Another approach is to fix the type of the MINUS_EXPR so that
it has the same type as minval and n->{high,low}.  I actually think
that's safer since with your change we'll still be creating (and
folding) MINUS_EXPR nodes where the type of the MINUS_EXPR does not
match the types of both operands.

I've actually got that change bootstrapping on my x86 and ppc
boxes right now.

Jeff



More information about the Gcc-patches mailing list