Re: [PATCH] -Warray-bounds TLC

2015-04-20 Thread Richard Biener
On Fri, 17 Apr 2015, Steve Ellcey wrote: > On Sat, 2015-04-18 at 00:15 +0200, Marc Glisse wrote: > > > > > > extern void bad (const char *__assertion) __attribute__ ((__noreturn__)); > > > struct link_map { long int l_ns; }; > > > extern struct link_namespaces > > > { > > >unsigned int _ns_n

Re: [PATCH] -Warray-bounds TLC

2015-04-17 Thread Steve Ellcey
On Sat, 2015-04-18 at 00:15 +0200, Marc Glisse wrote: > > > > extern void bad (const char *__assertion) __attribute__ ((__noreturn__)); > > struct link_map { long int l_ns; }; > > extern struct link_namespaces > > { > >unsigned int _ns_nloaded; > > } _dl_ns[1]; > > void _dl_close_worker (str

Re: [PATCH] -Warray-bounds TLC

2015-04-17 Thread Marc Glisse
On Fri, 17 Apr 2015, Steve Ellcey wrote: As a follow-up, I got the same error with dl-close.c from glibc and assumed it was the same type of code but when I looked at it and cut it down I got this code and error. This seems more like a real GCC error (in that it should not be warning). Note th

Re: [PATCH] -Warray-bounds TLC

2015-04-17 Thread Mike Stump
On Apr 17, 2015, at 1:52 PM, Steve Ellcey wrote: > struct link_namespaces *ns = &_dl_ns[nsid]; > (nsid != 0) ? (void) (0) : bad ("nsid != 0”); Without disagreeing with the fact this looks like a bug, ideally, the two lines above would be switched: c++98: If both the pointer operand and the

Re: [PATCH] -Warray-bounds TLC

2015-04-17 Thread Steve Ellcey
As a follow-up, I got the same error with dl-close.c from glibc and assumed it was the same type of code but when I looked at it and cut it down I got this code and error. This seems more like a real GCC error (in that it should not be warning). Note that I only get the error when bad is declared

Re: [PATCH] -Warray-bounds TLC

2015-04-17 Thread Steve Ellcey
On Fri, 2015-04-17 at 21:08 +0200, Marc Glisse wrote: > On Fri, 17 Apr 2015, Richard Biener wrote: > > >> The difference in behavior between bar and baz seems odd. > > > > Yeah, I suppose VRP gets conservative in a way that's not helpful for > > consistency of this warning. ~[0,0] and ~[-2,-2] l

Re: [PATCH] -Warray-bounds TLC

2015-04-17 Thread Marc Glisse
On Fri, 17 Apr 2015, Richard Biener wrote: The difference in behavior between bar and baz seems odd. Yeah, I suppose VRP gets conservative in a way that's not helpful for consistency of this warning. ~[0,0] and ~[-2,-2] likely meet as VARYING and the warning code doesn't look at equivalence

Re: [PATCH] -Warray-bounds TLC

2015-04-17 Thread Richard Biener
On April 17, 2015 8:01:42 PM GMT+02:00, Steve Ellcey wrote: >On Thu, 2015-04-16 at 13:55 +0200, Richard Biener wrote: >> The following applies the patch produced earlier this year, applying >> TLC to array bound warnings and catching a few more cases. >> >> Bootstrapped and tested on x86_64-unkno

Re: [PATCH] -Warray-bounds TLC

2015-04-17 Thread Steve Ellcey
On Thu, 2015-04-16 at 13:55 +0200, Richard Biener wrote: > The following applies the patch produced earlier this year, applying > TLC to array bound warnings and catching a few more cases. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. > > Richard. > > 2015-04-16 Richard Bien

[PATCH] -Warray-bounds TLC

2015-04-16 Thread Richard Biener
The following applies the patch produced earlier this year, applying TLC to array bound warnings and catching a few more cases. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2015-04-16 Richard Biener PR tree-optimization/64277 * tree-vrp.c (check_arr