This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix overzealous folding
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.