[PATCH] Warray-bounds: Warn only for generic address spaces

Siddhesh Poyarekar siddhesh@gotplt.org
Wed Oct 13 00:14:40 GMT 2021


On 10/13/21 00:36, Martin Sebor wrote:
> On 10/12/21 12:33 PM, Siddhesh Poyarekar wrote:
>> The warning is falsely triggered for THREAD_SELF in glibc when
>> accessing TCB through the segment register.
> 
> Thanks for looking into it!  The Glibc warning is being tracked
> in PR 102630.  The root cause behind it is in compute_objsize_r
> in pointer-query.cc (which is used by -Warray-bounds as well as
> other warnings).  I just posted a patch for it the other day;
> it's waiting for approval (though as Joseph noted, I need to
> adjust the test and either make it target-independent or move
> it under i386).

Ahh, targetm.addr_space.zero_address_valid was what I was looking for 
and didn't find.  Your fix looks good to me module moving the test out 
into gcc.target/i386.

Thanks,
Siddhesh


More information about the Gcc-patches mailing list