Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-07 Thread Joseph Myers
On Fri, 7 Feb 2020, Richard Biener wrote: > To me it's a QOI question that depends on the actual case. > Turning memcpy (p, p, N) into a no-op is the correct thing, > even though with (too) large N it might trap. Folding > a read from outside of an object to zero might be OK > (it's undefined),

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-07 Thread Jeff Law
On Thu, 2020-02-06 at 14:16 +0100, Richard Biener wrote: > On Thu, Feb 6, 2020 at 2:00 PM Jeff Law wrote: > > On Wed, 2020-02-05 at 09:19 +0100, Richard Biener wrote: > > > On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > > > > On 2/4/20 2:31 PM, Jeff Law wrote: > > > > > On Tue, 2020-02-04

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-07 Thread Richard Biener
On Fri, Feb 7, 2020 at 12:08 AM Martin Sebor wrote: > > On 2/6/20 6:16 AM, Richard Biener wrote: > > On Thu, Feb 6, 2020 at 2:00 PM Jeff Law wrote: > >> > >> On Wed, 2020-02-05 at 09:19 +0100, Richard Biener wrote: > >>> On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > On 2/4/20 2:31

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Martin Sebor
On 2/6/20 6:16 AM, Richard Biener wrote: On Thu, Feb 6, 2020 at 2:00 PM Jeff Law wrote: On Wed, 2020-02-05 at 09:19 +0100, Richard Biener wrote: On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: On 2/4/20 2:31 PM, Jeff Law wrote: On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor wrote:

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 2:00 PM Jeff Law wrote: > > On Wed, 2020-02-05 at 09:19 +0100, Richard Biener wrote: > > On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > > > On 2/4/20 2:31 PM, Jeff Law wrote: > > > > On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor wrote: > > > > > On 2/4/20 12:15

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Jeff Law
On Wed, 2020-02-05 at 09:19 +0100, Richard Biener wrote: > On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > > On 2/4/20 2:31 PM, Jeff Law wrote: > > > On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor wrote: > > > > On 2/4/20 12:15 PM, Richard Biener wrote: > > > > > On February 4, 2020

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 12:14 PM Richard Biener wrote: > > On Thu, Feb 6, 2020 at 11:33 AM Richard Biener > wrote: > > > > On Thu, Feb 6, 2020 at 11:06 AM Richard Biener > > wrote: > > > > > > On Wed, Feb 5, 2020 at 4:55 PM Martin Sebor wrote: > > > > > > > > On 2/5/20 1:19 AM, Richard Biener

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 11:33 AM Richard Biener wrote: > > On Thu, Feb 6, 2020 at 11:06 AM Richard Biener > wrote: > > > > On Wed, Feb 5, 2020 at 4:55 PM Martin Sebor wrote: > > > > > > On 2/5/20 1:19 AM, Richard Biener wrote: > > > > On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > > > >>

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 11:06 AM Richard Biener wrote: > > On Wed, Feb 5, 2020 at 4:55 PM Martin Sebor wrote: > > > > On 2/5/20 1:19 AM, Richard Biener wrote: > > > On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > > >> > > >> On 2/4/20 2:31 PM, Jeff Law wrote: > > >>> On Tue, 2020-02-04 at

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Wed, Feb 5, 2020 at 4:55 PM Martin Sebor wrote: > > On 2/5/20 1:19 AM, Richard Biener wrote: > > On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > >> > >> On 2/4/20 2:31 PM, Jeff Law wrote: > >>> On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor wrote: > On 2/4/20 12:15 PM, Richard

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-05 Thread Martin Sebor
On 2/5/20 1:19 AM, Richard Biener wrote: On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: On 2/4/20 2:31 PM, Jeff Law wrote: On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor wrote: On 2/4/20 12:15 PM, Richard Biener wrote: On February 4, 2020 5:30:42 PM GMT+01:00, Jeff Law wrote: On

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-05 Thread Richard Biener
On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > > On 2/4/20 2:31 PM, Jeff Law wrote: > > On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor wrote: > >> On 2/4/20 12:15 PM, Richard Biener wrote: > >>> On February 4, 2020 5:30:42 PM GMT+01:00, Jeff Law > >>> wrote: > On Tue, 2020-02-04 at

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-04 Thread Martin Sebor
On 2/4/20 2:31 PM, Jeff Law wrote: On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor wrote: On 2/4/20 12:15 PM, Richard Biener wrote: On February 4, 2020 5:30:42 PM GMT+01:00, Jeff Law wrote: On Tue, 2020-02-04 at 10:34 +0100, Richard Biener wrote: On Tue, Feb 4, 2020 at 1:44 AM Martin Sebor

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-04 Thread Jeff Law
On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor wrote: > On 2/4/20 12:15 PM, Richard Biener wrote: > > On February 4, 2020 5:30:42 PM GMT+01:00, Jeff Law wrote: > > > On Tue, 2020-02-04 at 10:34 +0100, Richard Biener wrote: > > > > On Tue, Feb 4, 2020 at 1:44 AM Martin Sebor wrote: > > > > > PR

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-04 Thread Martin Sebor
On 2/4/20 12:15 PM, Richard Biener wrote: On February 4, 2020 5:30:42 PM GMT+01:00, Jeff Law wrote: On Tue, 2020-02-04 at 10:34 +0100, Richard Biener wrote: On Tue, Feb 4, 2020 at 1:44 AM Martin Sebor wrote: PR 93519 reports a false positive -Wrestrict issued for an inlined call to strcpy

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-04 Thread Richard Biener
On February 4, 2020 5:30:42 PM GMT+01:00, Jeff Law wrote: >On Tue, 2020-02-04 at 10:34 +0100, Richard Biener wrote: >> On Tue, Feb 4, 2020 at 1:44 AM Martin Sebor wrote: >> > PR 93519 reports a false positive -Wrestrict issued for an inlined >call >> > to strcpy that carefully guards against

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-04 Thread Jeff Law
On Tue, 2020-02-04 at 10:34 +0100, Richard Biener wrote: > On Tue, Feb 4, 2020 at 1:44 AM Martin Sebor wrote: > > PR 93519 reports a false positive -Wrestrict issued for an inlined call > > to strcpy that carefully guards against self-copying. This is caused > > by the caller's arguments

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-04 Thread Martin Sebor
On 2/4/20 2:34 AM, Richard Biener wrote: On Tue, Feb 4, 2020 at 1:44 AM Martin Sebor wrote: PR 93519 reports a false positive -Wrestrict issued for an inlined call to strcpy that carefully guards against self-copying. This is caused by the caller's arguments substituted into the call during

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-04 Thread Richard Biener
On Tue, Feb 4, 2020 at 1:44 AM Martin Sebor wrote: > > PR 93519 reports a false positive -Wrestrict issued for an inlined call > to strcpy that carefully guards against self-copying. This is caused > by the caller's arguments substituted into the call during inlining and > before dead code

[PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-03 Thread Martin Sebor
PR 93519 reports a false positive -Wrestrict issued for an inlined call to strcpy that carefully guards against self-copying. This is caused by the caller's arguments substituted into the call during inlining and before dead code elimination. The attached patch avoids this by removing