Re: [PATCH] correct strncpy range computation in restrict pass (PR 94647)

2020-04-22 Thread Jeff Law via Gcc-patches
On Wed, 2020-04-22 at 09:36 -0600, Martin Sebor via Gcc-patches wrote: > On 4/22/20 7:28 AM, Christophe Lyon wrote: > > On Tue, 21 Apr 2020 at 11:07, Richard Biener via Gcc-patches > > wrote: > > > On Mon, Apr 20, 2020 at 11:29 PM Martin Sebor via Gcc-patches > > > wrote: > > > > The restrict pas

Re: [PATCH] correct strncpy range computation in restrict pass (PR 94647)

2020-04-22 Thread Martin Sebor via Gcc-patches
On 4/22/20 7:28 AM, Christophe Lyon wrote: On Tue, 21 Apr 2020 at 11:07, Richard Biener via Gcc-patches wrote: On Mon, Apr 20, 2020 at 11:29 PM Martin Sebor via Gcc-patches wrote: The restrict pass computes the wrong lower bound of the size of accesses to member arrays passed to strncpy as

Re: [PATCH] correct strncpy range computation in restrict pass (PR 94647)

2020-04-22 Thread Christophe Lyon via Gcc-patches
On Tue, 21 Apr 2020 at 11:07, Richard Biener via Gcc-patches wrote: > > On Mon, Apr 20, 2020 at 11:29 PM Martin Sebor via Gcc-patches > wrote: > > > > The restrict pass computes the wrong lower bound of the size > > of accesses to member arrays passed to strncpy as the source: > > it uses the thi

Re: [PATCH] correct strncpy range computation in restrict pass (PR 94647)

2020-04-21 Thread Richard Biener via Gcc-patches
On Mon, Apr 20, 2020 at 11:29 PM Martin Sebor via Gcc-patches wrote: > > The restrict pass computes the wrong lower bound of the size > of accesses to member arrays passed to strncpy as the source: > it uses the third argument to the function even though the size > of the read is limited by the le

[PATCH] correct strncpy range computation in restrict pass (PR 94647)

2020-04-20 Thread Martin Sebor via Gcc-patches
The restrict pass computes the wrong lower bound of the size of accesses to member arrays passed to strncpy as the source: it uses the third argument to the function even though the size of the read is limited by the length of the source when it is a string. This results in false positive -Warray