[PATCH] Fix overzealous folding

Richard Guenther richard.guenther@gmail.com
Tue May 27 22:21:00 GMT 2008


On Wed, May 28, 2008 at 12:02 AM, Mark Mitchell <mark@codesourcery.com> wrote:
> Richard Guenther wrote:
>
>> Still I'd like to remove more and more uses of TYPE_MIN/MAX_VALUE from the
>> middle-end, as as sonn as they deviate from what TYPE_PRECISION
>
> Why?  TYPE_{MIN,MAX}_VALUE seems like it's giving useful information to the
> optimizer.  That is a way in which enums and ints are different; why not let
> the optimizer take advantage?
>
> The situation that concerns me is that, if I understand correctly, Eric's
> patch is going to make:
>
>  enum E { low = INT_MIN, high = INT_MAX };
>
> behave different from "int" -- and I don't think it should.

But the only difference between this enum and int is their TYPE_MIN/MAX_VALUE.
So either you want the optimizer to take advantage of that difference or not.

Richard.



More information about the Gcc-patches mailing list