[PATCH] Possible Fix for PR42644 and PR42130

Tobias Grosser grosser@fim.uni-passau.de
Thu Jan 28 17:03:00 GMT 2010


On 01/28/10 15:08, Ramakrishna Upadrasta wrote:
> Thanks everyone for the feedback.
> 
> 2010/1/27 Tobias Grosser <grosser@fim.uni-passau.de>:
>>>> first you shouldn't compare TYPE_SIZE but instead use
>>>> types_compatible_p ().
>>>
>>> The attached patch does that.
>>
>> I am not too sure about this. I think we should do something like this
>>
>> if (!useless_type_conversion_p(long_long_integer_type_node, type)) {
>>  gloog_error = true;
>>  return error_mark_node;
>> }
>>
>> as types_compatible_p is a symmetric function, but we want to use a type
>> that has the same or bigger precision as the original one, but is signed.
> 
> I agree that we should be using the asymmetric function
> 'useless_type_conversion_p' instead of the symmetric
> 'types_compatible_p'. Made the change.
> 
> I do not think that we should return error_mark_node. It is causing
> errors further down the chain. Since we are setting the gloog_error as
> true, the checking of which is happening, with non-generation of
> incorrect code (especially for cases when the type is set to
> size_type), we are safe.
> 
> The above is an overly conservative approach and this kind of setting
> really begs for further type support, but as mentioned earlier, it is
> a temporary solution.
> 
> Sebastian: I have changed the second comment to reflect the idea that
> this needs CLooG support. Yes, the initial wording was imprecise.
> 
> Attached is the patch.

Hi Ramakrishna,

this one looks good to me. As I also worked with you on this patch, I
would like to wait for Sebastians approval. However for me it seems to
be fine to be committed to the graphite branch for testing on the SPEC
and gcc automatic testers.

Thanks a lot for your work

Tobias



More information about the Gcc-patches mailing list