Re: [PATCH] Fix VRP with -fno-delete-null-pointer-checks (PR c/88367)

2018-12-13 Thread Jeff Law
On 12/6/18 1:32 PM, Jakub Jelinek wrote: >> For -fno-delete-null-pointer-checks ISTM >> we should indicate "we don't know anything about the result" of such an >> operation. > > There are cases where we still know something. The largest valid object > that can be supported is half of the

Re: [PATCH] Fix VRP with -fno-delete-null-pointer-checks (PR c/88367)

2018-12-06 Thread Jakub Jelinek
On Thu, Dec 06, 2018 at 01:08:34PM -0700, Jeff Law wrote: > > I hope we can still say that pointer wrapping even with > > -fno-delete-null-pointer-checks is UB, so this patch differentiates between > > positive offsets (in ssizetype), negative offsets (in ssizetype) and zero > > offsets and

Re: [PATCH] Fix VRP with -fno-delete-null-pointer-checks (PR c/88367)

2018-12-06 Thread Jeff Law
On 12/5/18 11:45 PM, Jakub Jelinek wrote: > Hi! > > If we consider -fno-delete-null-pointer-checks as a way to support e.g. AVR > and other targets which can validly place objects at NULL rather than a way > to workaround UBs in code, I believe the following testcase must pass if > there is e.g.

Re: [PATCH] Fix VRP with -fno-delete-null-pointer-checks (PR c/88367, take 2)

2018-12-06 Thread Richard Biener
On Thu, 6 Dec 2018, Jakub Jelinek wrote: > On Thu, Dec 06, 2018 at 10:05:15AM +0100, Richard Biener wrote: > > Note I wonder if with -fwrapv-pointer NULL automatically becomes a > > valid address? Or is only wrapping around half of the address > > space UB? > > Hadn't thought about

[PATCH] Fix VRP with -fno-delete-null-pointer-checks (PR c/88367, take 2)

2018-12-06 Thread Jakub Jelinek
On Thu, Dec 06, 2018 at 10:05:15AM +0100, Richard Biener wrote: > Note I wonder if with -fwrapv-pointer NULL automatically becomes a > valid address? Or is only wrapping around half of the address > space UB? Hadn't thought about -fwrapv-pointer, I guess we (especially with

Re: [PATCH] Fix VRP with -fno-delete-null-pointer-checks (PR c/88367)

2018-12-06 Thread Richard Biener
On Thu, 6 Dec 2018, Jakub Jelinek wrote: > Hi! > > If we consider -fno-delete-null-pointer-checks as a way to support e.g. AVR > and other targets which can validly place objects at NULL rather than a way > to workaround UBs in code, I believe the following testcase must pass if > there is e.g.

[PATCH] Fix VRP with -fno-delete-null-pointer-checks (PR c/88367)

2018-12-05 Thread Jakub Jelinek
Hi! If we consider -fno-delete-null-pointer-checks as a way to support e.g. AVR and other targets which can validly place objects at NULL rather than a way to workaround UBs in code, I believe the following testcase must pass if there is e.g. char a[32]; // And this object ends up at