[PATCH] Fix overzealous folding

Richard Guenther richard.guenther@gmail.com
Fri May 30 11:36:00 GMT 2008


On Fri, May 30, 2008 at 9:36 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Eric, would you please look into this
>
> Already done, please re-read the thread.
>
>> and work out what we really ought to be doing here?
>
> Already done as well: properly disable the folding or rewrite VRP to avoid
> taking advantage of TYPE_MIN/MAX_VALUE.
>
>> And, would you please add a comment to the code that you changed that
>> indicates that the exclusion of ENUMERAL_TYPEs is a work-around, with a
>> link to the PR so that we know why?
>
> Here's what I've installed on the mainline.  The exclusion of BOOLEAN_TYPE has
> been there from day #1 apparently.

Yep.  Note that fold is really a special place in GCC - it is used from both
the frontends and the middle-end and seemingly arguing from middle-end
semantics point may well break the frontends if they (wrongly?) assume
that the (not written down) middle-end semantics do not apply, but their
frontend semantics.

I wouldn't be surprised if removing the BOOLEAN_TYPE check broke
C or C++ at least ;)

Richard.



More information about the Gcc-patches mailing list