[PATCH] Fix c/69643, named address space wrong-code

Richard Biener richard.guenther@gmail.com
Wed Feb 3 13:46:00 GMT 2016


On February 3, 2016 8:11:01 AM GMT+01:00, Richard Henderson <rth@redhat.com> wrote:
>On 02/03/2016 06:05 PM, Richard Biener wrote:
>  I wasn't aware that STRIP_NOPS strips ADDR_SPACE_CONVERT_EXPR.
>>
>> Isn't this maybe failing to use that (unable to look at the
>attachment from my phone).
>
>The test case does fail to use ADDR_SPACE_CONVERT_EXPR.
>Perhaps it's because of the intermediate cast to uintptr_t?

Ah.  Isn't to/from int conversion also address-space specific?

I wonder if it makes sense to have ADDR_SPACE_CONVERT if there is the loophole of going through an integer type...

That is, if the address spaces are not subsets, how can going through an int make sense? Isn't the testcase somehow invalid then?

>Of course, for this case, the intermediate cast is required
>because __seg_[fg]s are *not* subsets of ADDR_SPACE_GENERIC,
>and thus a direct cast between the pointer types results in
>an error message.

As for a patch I'd repeatedly pondered on not stripping int <-> pointer conversions at all, similar to what STRIP_SIGN_NOPS does.  Don't remember actually trying this or the fallout though.

Richard.

>
>r~




More information about the Gcc-patches mailing list