Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-10-05 Thread Szabolcs Nagy via Gcc-patches
The 09/23/2020 21:45, Jeff Law wrote: > On 9/23/20 11:45 AM, Martin Sebor via Gcc-patches wrote: > > On 9/23/20 9:44 AM, Szabolcs Nagy wrote: > > > The 09/23/2020 09:22, Szabolcs Nagy wrote: > > > > The 09/21/2020 12:45, Martin Sebor via Gcc-patches wrote: > > > > > On 9/21/20 12:20 PM, Vaseeharan

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-23 Thread Jeff Law via Gcc-patches
On 9/23/20 11:45 AM, Martin Sebor via Gcc-patches wrote: On 9/23/20 9:44 AM, Szabolcs Nagy wrote: The 09/23/2020 09:22, Szabolcs Nagy wrote: The 09/21/2020 12:45, Martin Sebor via Gcc-patches wrote: On 9/21/20 12:20 PM, Vaseeharan Vinayagamoorthy wrote: After this patch, I am seeing this

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-23 Thread Martin Sebor via Gcc-patches
On 9/23/20 9:44 AM, Szabolcs Nagy wrote: The 09/23/2020 09:22, Szabolcs Nagy wrote: The 09/21/2020 12:45, Martin Sebor via Gcc-patches wrote: On 9/21/20 12:20 PM, Vaseeharan Vinayagamoorthy wrote: After this patch, I am seeing this -Warray-parameter error: In file included from

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-23 Thread Szabolcs Nagy
The 09/23/2020 09:22, Szabolcs Nagy wrote: > The 09/21/2020 12:45, Martin Sebor via Gcc-patches wrote: > > On 9/21/20 12:20 PM, Vaseeharan Vinayagamoorthy wrote: > > > After this patch, I am seeing this -Warray-parameter error: > > > > > > In file included from ../include/pthread.h:1, > > >

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-23 Thread Szabolcs Nagy
The 09/21/2020 12:45, Martin Sebor via Gcc-patches wrote: > On 9/21/20 12:20 PM, Vaseeharan Vinayagamoorthy wrote: > > After this patch, I am seeing this -Warray-parameter error: > > > > In file included from ../include/pthread.h:1, > > from ../sysdeps/nptl/thread_db.h:25, > >

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-21 Thread Martin Sebor via Gcc-patches
On 9/21/20 12:20 PM, Vaseeharan Vinayagamoorthy wrote: After this patch, I am seeing this -Warray-parameter error: In file included from ../include/pthread.h:1, from ../sysdeps/nptl/thread_db.h:25, from ../nptl/descr.h:32, from

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-21 Thread Vaseeharan Vinayagamoorthy
After this patch, I am seeing this -Warray-parameter error: In file included from ../include/pthread.h:1, from ../sysdeps/nptl/thread_db.h:25, from ../nptl/descr.h:32, from ../sysdeps/aarch64/nptl/tls.h:44, from

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-19 Thread Martin Sebor via Gcc-patches
On 9/17/20 4:38 PM, Joseph Myers wrote: On Wed, 16 Sep 2020, Martin Sebor via Gcc-patches wrote: Attached is an updated revision of the patch. Besides the tweaks above it also contains a cosmetic change to the warning issued for mismatches in unspecified VLA bounds: it points at the decl with

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-17 Thread Joseph Myers
On Wed, 16 Sep 2020, Martin Sebor via Gcc-patches wrote: > Attached is an updated revision of the patch. Besides the tweaks > above it also contains a cosmetic change to the warning issued > for mismatches in unspecified VLA bounds: it points at the decl > with more of them to guide the user to

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-16 Thread Martin Sebor via Gcc-patches
On 9/15/20 5:02 PM, Joseph Myers wrote: On Wed, 9 Sep 2020, Martin Sebor via Gcc-patches wrote: Joseph, do you have any concerns with or comments on the most recent patch or is it okay as is? https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552266.html I'm not yet convinced by the

Re: [PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-15 Thread Joseph Myers
On Wed, 9 Sep 2020, Martin Sebor via Gcc-patches wrote: > Joseph, do you have any concerns with or comments on the most > recent patch or is it okay as is? > > https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552266.html I'm not yet convinced by the logic for extracting an array bound from

[PING 2][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-09 Thread Martin Sebor via Gcc-patches
Joseph, do you have any concerns with or comments on the most recent patch or is it okay as is? https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552266.html Martin On 9/2/20 6:03 PM, Martin Sebor wrote: Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552266.html On 8/25/20

[PING][PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-09-02 Thread Martin Sebor via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552266.html On 8/25/20 12:44 PM, Martin Sebor wrote: Joseph, do you have any more comments on the rest of the most recent revision of the patch? https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552266.html Martin On 8/19/20

Re: [PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-08-25 Thread Martin Sebor via Gcc-patches
Joseph, do you have any more comments on the rest of the most recent revision of the patch? https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552266.html Martin On 8/19/20 6:09 PM, Joseph Myers wrote: On Wed, 19 Aug 2020, Martin Sebor via Gcc-patches wrote: I think you need a while loop

Re: [PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-08-21 Thread Martin Sebor via Gcc-patches
On 8/19/20 6:09 PM, Joseph Myers wrote: On Wed, 19 Aug 2020, Martin Sebor via Gcc-patches wrote: I think you need a while loop there, not just an if, to account for the case of multiple consecutive cdk_attrs. At least the GNU attribute syntax direct-declarator: [...] (

Re: [PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-08-19 Thread Joseph Myers
On Wed, 19 Aug 2020, Martin Sebor via Gcc-patches wrote: > > I think you need a while loop there, not just an if, to account for the > > case of multiple consecutive cdk_attrs. At least the GNU attribute syntax > > > > direct-declarator: > > [...] > > ( gnu-attributes[opt] declarator

Re: [PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-08-19 Thread Martin Sebor via Gcc-patches
On 8/17/20 4:09 PM, Joseph Myers wrote: On Thu, 13 Aug 2020, Martin Sebor via Gcc-patches wrote: * Maybe cdk_pointer is followed by cdk_attrs before cdk_id. In this case the code won't return. I think I see the problem you're pointing out (I just don't see how to trigger it or test that it

Re: [PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-08-17 Thread Joseph Myers
On Thu, 13 Aug 2020, Martin Sebor via Gcc-patches wrote: > > * Maybe cdk_pointer is followed by cdk_attrs before cdk_id. In this case > > the code won't return. > > I think I see the problem you're pointing out (I just don't see how > to trigger it or test that it doesn't happen). If the tweak

Re: [PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-08-13 Thread Martin Sebor via Gcc-patches
On 8/12/20 5:19 PM, Joseph Myers wrote: On Fri, 7 Aug 2020, Martin Sebor via Gcc-patches wrote: I don't see anything in the tests in this patch to cover this sort of case (arrays of pointers, including arrays of pointers to arrays etc.). I've added a few test cases and reworked the

Re: [PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-08-12 Thread Joseph Myers
On Fri, 7 Aug 2020, Martin Sebor via Gcc-patches wrote: > > I don't see anything in the tests in this patch to cover this sort of case > > (arrays of pointers, including arrays of pointers to arrays etc.). > > I've added a few test cases and reworked the declarator parsing >

Re: [PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-08-07 Thread Martin Sebor via Gcc-patches
On 7/29/20 12:12 PM, Joseph Myers wrote: On Tue, 28 Jul 2020, Martin Sebor via Gcc-patches wrote: + /* A list of VLA variable bounds or null if not specified. */ + tree vbchain = NULL_TREE; + if (parm->declarator->kind == cdk_array) + if (pd->kind != cdk_array) +

Re: [PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-07-29 Thread Joseph Myers
On Tue, 28 Jul 2020, Martin Sebor via Gcc-patches wrote: > + /* A list of VLA variable bounds or null if not specified. */ > + tree vbchain = NULL_TREE; > + if (parm->declarator->kind == cdk_array) > + if (pd->kind != cdk_array) > + break; > + /* Skip all constant

[PATCH 2/5] C front end support to detect out-of-bounds accesses to array parameters

2020-07-28 Thread Martin Sebor via Gcc-patches
Patch 2 adds support for the internal attribute access specification for array/VLA parameters to the C front end and two new options to control warnings. The attribute is added in two steps: first, push_parm_decl adds a new attribute "arg spec" to each array parameter with a string describing