Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-04 Thread Jason Merrill via Gcc-patches
On 3/4/21 12:44 PM, Martin Sebor wrote: On 3/3/21 10:33 PM, Jason Merrill wrote: On 3/3/21 6:20 PM, Martin Sebor wrote: ... I see what you mean, thanks, but I can't think of a test case to trigger a false negative due to the smaller offset.  Any suggestions? My only ideas involve undefined b

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-04 Thread Martin Sebor via Gcc-patches
On 3/3/21 10:33 PM, Jason Merrill wrote: On 3/3/21 6:20 PM, Martin Sebor wrote: ... I see what you mean, thanks, but I can't think of a test case to trigger a false negative due to the smaller offset.  Any suggestions? My only ideas involve undefined behavior, casting the address to a pointe

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-03 Thread Jason Merrill via Gcc-patches
On 3/3/21 6:20 PM, Martin Sebor wrote: On 3/2/21 7:11 AM, Jason Merrill wrote: On 3/1/21 6:11 PM, Martin Sebor wrote: On 2/24/21 5:35 PM, Jason Merrill wrote: On 2/23/21 6:07 PM, Martin Sebor wrote: On 2/23/21 2:52 PM, Jason Merrill wrote: On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-03 Thread Martin Sebor via Gcc-patches
On 3/2/21 7:11 AM, Jason Merrill wrote: On 3/1/21 6:11 PM, Martin Sebor wrote: On 2/24/21 5:35 PM, Jason Merrill wrote: On 2/23/21 6:07 PM, Martin Sebor wrote: On 2/23/21 2:52 PM, Jason Merrill wrote: On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason for any further comments/clarification]

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-02 Thread Jason Merrill via Gcc-patches
On 3/1/21 6:11 PM, Martin Sebor wrote: On 2/24/21 5:35 PM, Jason Merrill wrote: On 2/23/21 6:07 PM, Martin Sebor wrote: On 2/23/21 2:52 PM, Jason Merrill wrote: On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason for any further comments/clarification] On 2/9/21 10:49 AM, Martin Sebor wrote:

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-01 Thread Martin Sebor via Gcc-patches
On 2/25/21 4:40 PM, Jeff Law wrote: On 2/8/21 3:44 PM, Martin Sebor wrote: I think the underlying problem is the same.  We're getting a size that doesn't correspond to what's actually being accessed, and it happens because of the virtual inheritance.  In pr97595 Jason suggested to use the dec

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-01 Thread Martin Sebor via Gcc-patches
On 2/24/21 5:35 PM, Jason Merrill wrote: On 2/23/21 6:07 PM, Martin Sebor wrote: On 2/23/21 2:52 PM, Jason Merrill wrote: On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason for any further comments/clarification] On 2/9/21 10:49 AM, Martin Sebor wrote: On 2/8/21 4:11 PM, Jeff Law wrote: O

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-25 Thread Jason Merrill via Gcc-patches
On 2/25/21 6:47 PM, Jeff Law wrote: On 2/23/21 2:52 PM, Jason Merrill wrote: I don't see how the issue here depends on the artificiality of the vptr; That's what I was trying to get at -- is DECL_ARTIFICIAL really a good way to detect these kinds of cases.  It sounds like it likely isn't, bu

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-25 Thread Jeff Law via Gcc-patches
On 2/23/21 2:52 PM, Jason Merrill wrote: > > I don't see how the issue here depends on the artificiality of the vptr; That's what I was trying to get at -- is DECL_ARTIFICIAL really a good way to detect these kinds of cases.  It sounds like it likely isn't, but it may also be the best we can do.

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-25 Thread Jeff Law via Gcc-patches
On 2/8/21 3:44 PM, Martin Sebor wrote: > > I think the underlying problem is the same.  We're getting a size > that doesn't correspond to what's actually being accessed, and it > happens because of the virtual inheritance.  In pr97595 Jason > suggested to use the decl/type size inequality to ide

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-25 Thread Jeff Law via Gcc-patches
On 2/8/21 2:56 PM, Martin Sebor wrote: > On 2/8/21 12:59 PM, Jeff Law wrote: >> >> >> On 1/19/21 5:56 PM, Martin Sebor via Gcc-patches wrote: >>> Similar to the problem reported for -Wstringop-overflow in pr98266 >>> and already fixed, -Warray-bounds is also susceptible to false >>> positives in

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-24 Thread Jason Merrill via Gcc-patches
On 2/23/21 6:07 PM, Martin Sebor wrote: On 2/23/21 2:52 PM, Jason Merrill wrote: On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason for any further comments/clarification] On 2/9/21 10:49 AM, Martin Sebor wrote: On 2/8/21 4:11 PM, Jeff Law wrote: On 2/8/21 3:44 PM, Martin Sebor wrote: On

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-23 Thread Martin Sebor via Gcc-patches
On 2/23/21 2:52 PM, Jason Merrill wrote: On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason for any further comments/clarification] On 2/9/21 10:49 AM, Martin Sebor wrote: On 2/8/21 4:11 PM, Jeff Law wrote: On 2/8/21 3:44 PM, Martin Sebor wrote: On 2/8/21 3:26 PM, Jeff Law wrote: On 2/8

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-23 Thread Jason Merrill via Gcc-patches
On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason for any further comments/clarification] On 2/9/21 10:49 AM, Martin Sebor wrote: On 2/8/21 4:11 PM, Jeff Law wrote: On 2/8/21 3:44 PM, Martin Sebor wrote: On 2/8/21 3:26 PM, Jeff Law wrote: On 2/8/21 2:56 PM, Martin Sebor wrote: On 2/8/2

PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-23 Thread Martin Sebor via Gcc-patches
[CC Jason for any further comments/clarification] On 2/9/21 10:49 AM, Martin Sebor wrote: On 2/8/21 4:11 PM, Jeff Law wrote: On 2/8/21 3:44 PM, Martin Sebor wrote: On 2/8/21 3:26 PM, Jeff Law wrote: On 2/8/21 2:56 PM, Martin Sebor wrote: On 2/8/21 12:59 PM, Jeff Law wrote: On 1/19/21

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-09 Thread Martin Sebor via Gcc-patches
On 2/8/21 4:11 PM, Jeff Law wrote: On 2/8/21 3:44 PM, Martin Sebor wrote: On 2/8/21 3:26 PM, Jeff Law wrote: On 2/8/21 2:56 PM, Martin Sebor wrote: On 2/8/21 12:59 PM, Jeff Law wrote: On 1/19/21 5:56 PM, Martin Sebor via Gcc-patches wrote: Similar to the problem reported for -Wstringop

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-08 Thread Jeff Law via Gcc-patches
On 2/8/21 3:44 PM, Martin Sebor wrote: > On 2/8/21 3:26 PM, Jeff Law wrote: >> >> >> On 2/8/21 2:56 PM, Martin Sebor wrote: >>> On 2/8/21 12:59 PM, Jeff Law wrote: On 1/19/21 5:56 PM, Martin Sebor via Gcc-patches wrote: > Similar to the problem reported for -Wstringop-overflow

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-08 Thread Martin Sebor via Gcc-patches
On 2/8/21 3:26 PM, Jeff Law wrote: On 2/8/21 2:56 PM, Martin Sebor wrote: On 2/8/21 12:59 PM, Jeff Law wrote: On 1/19/21 5:56 PM, Martin Sebor via Gcc-patches wrote: Similar to the problem reported for -Wstringop-overflow in pr98266 and already fixed, -Warray-bounds is also susceptible to

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-08 Thread Jeff Law via Gcc-patches
On 2/8/21 2:56 PM, Martin Sebor wrote: > On 2/8/21 12:59 PM, Jeff Law wrote: >> >> >> On 1/19/21 5:56 PM, Martin Sebor via Gcc-patches wrote: >>> Similar to the problem reported for -Wstringop-overflow in pr98266 >>> and already fixed, -Warray-bounds is also susceptible to false >>> positives in

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-08 Thread Martin Sebor via Gcc-patches
On 2/8/21 12:59 PM, Jeff Law wrote: On 1/19/21 5:56 PM, Martin Sebor via Gcc-patches wrote: Similar to the problem reported for -Wstringop-overflow in pr98266 and already fixed, -Warray-bounds is also susceptible to false positives in assignments and copies involving virtual inheritance. Becau

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-08 Thread Jeff Law via Gcc-patches
On 1/19/21 5:56 PM, Martin Sebor via Gcc-patches wrote: > Similar to the problem reported for -Wstringop-overflow in pr98266 > and already fixed, -Warray-bounds is also susceptible to false > positives in assignments and copies involving virtual inheritance. > Because the two warnings don't shar

PING 2 [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-06 Thread Martin Sebor via Gcc-patches
Ping 2: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563894.html On 1/29/21 10:22 AM, Martin Sebor wrote: Ping: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563894.html On 1/19/21 5:56 PM, Martin Sebor wrote: Similar to the problem reported for -Wstringop-overflow in pr98

PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-01-29 Thread Martin Sebor via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563894.html On 1/19/21 5:56 PM, Martin Sebor wrote: Similar to the problem reported for -Wstringop-overflow in pr98266 and already fixed, -Warray-bounds is also susceptible to false positives in assignments and copies involving virtual

[PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-01-19 Thread Martin Sebor via Gcc-patches
Similar to the problem reported for -Wstringop-overflow in pr98266 and already fixed, -Warray-bounds is also susceptible to false positives in assignments and copies involving virtual inheritance. Because the two warnings don't share code yet (hopefully in GCC 12) the attached patch adds its own w