[PATCH] Fix overzealous folding

Mark Mitchell mark@codesourcery.com
Thu May 29 20:28:00 GMT 2008


Richard Guenther wrote:

> No.  At least I wasn't able to pinpoint what goes wrong with Erics
> testcase (but it's
> Ada, so I don't properly understand what it is supposed to do).  But in general
> VRP is trying to _not_ use TYPE_MIN/MAX_VALUE information because in
> general this is just false information and for example fold happily creates
> expressions or constants that have values outside of their TYPE_MIN/MAX_VALUE
> range.  Arguable these are all bugs, but this is just fighting
> windmills, as fold
> is still built up on the principle that types can hold all values
> their mode can!

I understand that we're not handling TYPE_{MIN,MAX}_VALUE consistently 
at this point, and that we may have to remove some of the stuff we 
presently have to improve correctness until we get a coherent plan in place.

However, I still don't understand how any of this applies specially to 
ENUMERAL_TYPE.  Why does it make sense to test that the type is not an 
ENUMERAL_TYPE before making whatever decision is being made in this case?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list