This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH]: Fix missed PRE optimization discovered
On Sat, Oct 18, 2008 at 7:19 PM, Daniel Berlin <email@example.com> wrote:
> On Sat, Oct 18, 2008 at 6:27 AM, Richard Guenther
> <firstname.lastname@example.org> wrote:
>> On Sat, Oct 18, 2008 at 4:02 AM, Daniel Berlin <email@example.com> 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 ...