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 missed PRE optimization discovered


On Sat, Oct 18, 2008 at 7:19 PM, Daniel Berlin <dberlin@dberlin.org> wrote:
> On Sat, Oct 18, 2008 at 6:27 AM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> On Sat, Oct 18, 2008 at 4:02 AM, Daniel Berlin <dberlin@dberlin.org> wrote:
>>> I'm currently testing the following, which at least doesn't crash on
>>> the minimized testcase i produced :)
>>
>> Looking at that patch I wonder if
>>
>> -          if (TREE_TYPE (constant) != type)
>> +         if (!useless_type_conversion_p (type, TREE_TYPE (constant)))
>>
>> will also work.
>
> Probably, but we really shouldn't just willy nilly replace one with
> the other anyway. :)
>
> If you like, i can try both :)

Yes please ;)

> At worst what is going to happen is that we will call fold_convert a
> few more times than necessary, and in very strange cases (where
> converting one constant to the other requires a real conversion),
> create a small amount of necessary code.

Well, IMHO every time we hit this type-not-compatible case there should
be a bug elsewhere ...

Richard.

>>
>


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