[PATCH] Possible Fix for PR42644 and PR42130

Ramakrishna Upadrasta uramakrishna@gmail.com
Thu Jan 28 15:35:00 GMT 2010


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.

Thanks
Ramakrishna
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-DealII-type-problems.patch
Type: application/octet-stream
Size: 4284 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100128/a502b955/attachment.obj>


More information about the Gcc-patches mailing list