Re: Optimize callers using nonnull attribute

2013-10-11 Thread Mike Stump
On Oct 11, 2013, at 7:21 AM, Marc Glisse wrote: > I just read this note in libiberty/concat.c: > I am afraid that if I add the returns_nonnull attribute to xmalloc in > include/libiberty.h, it will break this supported use, no? Or is this comment > out-of-date? I think the comment should be up

Re: Optimize callers using nonnull attribute

2013-10-11 Thread Jakub Jelinek
On Fri, Oct 11, 2013 at 04:21:04PM +0200, Marc Glisse wrote: > On Fri, 11 Oct 2013, Jakub Jelinek wrote: > > >OT, do you plan to define ATTRIBUTE_RETURNS_NONNULL for > >GCC_VERSION >= 4009 in ansidecl.h and use it on the various xmalloc > >etc. prototypes? > > I just read this note in libiberty/c

Re: Optimize callers using nonnull attribute

2013-10-11 Thread Marc Glisse
On Fri, 11 Oct 2013, Jakub Jelinek wrote: OT, do you plan to define ATTRIBUTE_RETURNS_NONNULL for GCC_VERSION >= 4009 in ansidecl.h and use it on the various xmalloc etc. prototypes? I just read this note in libiberty/concat.c: This function uses xmalloc() which is expected to be a fr

Re: Optimize callers using nonnull attribute

2013-10-11 Thread Marc Glisse
On Fri, 11 Oct 2013, Marc Glisse wrote: On Fri, 11 Oct 2013, Jakub Jelinek wrote: OT, do you plan to define ATTRIBUTE_RETURNS_NONNULL for GCC_VERSION >= 4009 in ansidecl.h and use it on the various xmalloc etc. prototypes? I was planning to at least have a look at some point. I can do that n

Re: Optimize callers using nonnull attribute

2013-10-11 Thread Marc Glisse
On Fri, 11 Oct 2013, Jakub Jelinek wrote: On Mon, Oct 07, 2013 at 03:52:25PM +0200, Marc Glisse wrote: 2013-10-08 Marc Glisse PR tree-optimization/58480 gcc/ * tree-vrp.c (infer_nonnull_range): New function. (infer_value_range): Call infer_nonnull_range. This broke

Re: Optimize callers using nonnull attribute

2013-10-11 Thread Jakub Jelinek
On Mon, Oct 07, 2013 at 03:52:25PM +0200, Marc Glisse wrote: > 2013-10-08 Marc Glisse > > PR tree-optimization/58480 > gcc/ > * tree-vrp.c (infer_nonnull_range): New function. > (infer_value_range): Call infer_nonnull_range. This broke whole bunch of OpenMP tests. Internal c

Re: Optimize callers using nonnull attribute

2013-10-08 Thread Richard Biener
On Mon, Oct 7, 2013 at 3:52 PM, Marc Glisse wrote: > On Mon, 7 Oct 2013, Richard Biener wrote: > >> On Mon, Oct 7, 2013 at 12:33 AM, Marc Glisse wrote: >>> >>> Hello, >>> >>> this patch asserts that when we call a function with the nonnull >>> attribute, >>> the corresponding argument is not zero

Re: Optimize callers using nonnull attribute

2013-10-07 Thread Jeff Law
On 10/07/13 07:52, Marc Glisse wrote: On Mon, 7 Oct 2013, Richard Biener wrote: On Mon, Oct 7, 2013 at 12:33 AM, Marc Glisse wrote: Hello, this patch asserts that when we call a function with the nonnull attribute, the corresponding argument is not zero, just like when we dereference a point

Re: Optimize callers using nonnull attribute

2013-10-07 Thread Marc Glisse
On Mon, 7 Oct 2013, Richard Biener wrote: On Mon, Oct 7, 2013 at 12:33 AM, Marc Glisse wrote: Hello, this patch asserts that when we call a function with the nonnull attribute, the corresponding argument is not zero, just like when we dereference a pointer. Everything is under a check for fla

Re: Optimize callers using nonnull attribute

2013-10-07 Thread Richard Biener
On Mon, Oct 7, 2013 at 12:33 AM, Marc Glisse wrote: > Hello, > > this patch asserts that when we call a function with the nonnull attribute, > the corresponding argument is not zero, just like when we dereference a > pointer. Everything is under a check for flag_delete_null_pointer_checks. > > Not

Optimize callers using nonnull attribute

2013-10-06 Thread Marc Glisse
Hello, this patch asserts that when we call a function with the nonnull attribute, the corresponding argument is not zero, just like when we dereference a pointer. Everything is under a check for flag_delete_null_pointer_checks. Note that this function currently gives up if the statement may