Re: [PATCH] Don't issue array bound warnings on zero-length arrays

2013-09-03 Thread Jakub Jelinek
On Tue, Sep 03, 2013 at 10:40:16AM -0500, Meador Inge wrote: > > And I fail to see why the testcase should > > not warn. Clearly you have a definition of a here and it doesn't have > > an element > > so the access is out of bounds. > > Not always, 'size_a' can be zero and the warning is worded su

Re: [PATCH] Don't issue array bound warnings on zero-length arrays

2013-09-03 Thread Jakub Jelinek
On Tue, Sep 03, 2013 at 11:01:17AM -0500, Meador Inge wrote: > On 09/03/2013 10:45 AM, Jakub Jelinek wrote: > > > On Tue, Sep 03, 2013 at 10:40:16AM -0500, Meador Inge wrote: > >>> And I fail to see why the testcase should > >>> not warn. Clearly you have a definition of a here and it doesn't hav

Re: [PATCH] Don't issue array bound warnings on zero-length arrays

2013-09-03 Thread Meador Inge
On 09/03/2013 10:45 AM, Jakub Jelinek wrote: > On Tue, Sep 03, 2013 at 10:40:16AM -0500, Meador Inge wrote: >>> And I fail to see why the testcase should >>> not warn. Clearly you have a definition of a here and it doesn't have >>> an element >>> so the access is out of bounds. >> >> Not always,

Re: [PATCH] Don't issue array bound warnings on zero-length arrays

2013-09-03 Thread Meador Inge
On 09/02/2013 04:27 AM, Richard Biener wrote: > On Fri, Aug 30, 2013 at 5:13 PM, Meador Inge wrote: >> Hi All, >> >> This patch fixes a minor issue that can occur when issuing array bounds >> warnings. In GNU C mode we allow empty lists and their upper bound is >> initialized to -1. This confuse

Re: [PATCH] Don't issue array bound warnings on zero-length arrays

2013-09-02 Thread Richard Biener
On Fri, Aug 30, 2013 at 5:13 PM, Meador Inge wrote: > Hi All, > > This patch fixes a minor issue that can occur when issuing array bounds > warnings. In GNU C mode we allow empty lists and their upper bound is > initialized to -1. This confuses the array bound analysis in VRP and > in some cases

Re: [PATCH] Don't issue array bound warnings on zero-length arrays

2013-08-30 Thread Jeff Law
On 08/30/2013 09:13 AM, Meador Inge wrote: Hi All, This patch fixes a minor issue that can occur when issuing array bounds warnings. In GNU C mode we allow empty lists and their upper bound is initialized to -1. This confuses the array bound analysis in VRP and in some cases we end up issuing

[PATCH] Don't issue array bound warnings on zero-length arrays

2013-08-30 Thread Meador Inge
Hi All, This patch fixes a minor issue that can occur when issuing array bounds warnings. In GNU C mode we allow empty lists and their upper bound is initialized to -1. This confuses the array bound analysis in VRP and in some cases we end up issuing false positives. This patch fixes the issue