This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix overzealous folding


On Thu, May 29, 2008 at 10:17 PM, Mark Mitchell <mark@codesourcery.com> wrote:
> 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?

It doesn't make sense.  Like it doesn't make sense to test that it is
not a BOOLEAN_TYPE.
But it papers over(?) a problem elsewhere and fixes the wrong-code bug for Ada.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]