Re: [PATCH] Add alloc_align and assume_aligned attributes (PR middle-end/60092)

2014-07-06 Thread Gerald Pfeifer
On Thu, 6 Feb 2014, Jakub Jelinek wrote: > As discussed on IRC, this patch introduces two new attributes, > so that the C library (and other headers) have a way to > a) tell the compiler something about functions like aligned_alloc >or memalign > b) tell the compiler the alignment of pointers r

Re: [PATCH] Add alloc_align and assume_aligned attributes (PR middle-end/60092)

2014-02-07 Thread Bernhard Reutner-Fischer
On 6 February 2014 16:42:05 Jakub Jelinek wrote: Hi! As discussed on IRC, this patch introduces two new attributes, so that the C library (and other headers) have a way to a) tell the compiler something about functions like aligned_alloc or memalign b) tell the compiler the alignment of poi

Re: [PATCH] Add alloc_align and assume_aligned attributes (PR middle-end/60092)

2014-02-07 Thread Richard Biener
On Fri, 7 Feb 2014, Jakub Jelinek wrote: > On Fri, Feb 07, 2014 at 10:02:29AM +0100, Richard Biener wrote: > > > + if (TREE_CODE (position) != INTEGER_CST > > > + || TREE_INT_CST_HIGH (position) > > > + || TREE_INT_CST_LOW (position) < 1 > > > + || TREE_INT_CST_LOW (position) > arg

Re: [PATCH] Add alloc_align and assume_aligned attributes (PR middle-end/60092)

2014-02-07 Thread Jakub Jelinek
On Fri, Feb 07, 2014 at 10:02:29AM +0100, Richard Biener wrote: > > + if (TREE_CODE (position) != INTEGER_CST > > + || TREE_INT_CST_HIGH (position) > > + || TREE_INT_CST_LOW (position) < 1 > > + || TREE_INT_CST_LOW (position) > arg_count) > > You make it easier for wide-int folks i

Re: [PATCH] Add alloc_align and assume_aligned attributes (PR middle-end/60092)

2014-02-07 Thread Richard Biener
On Thu, 6 Feb 2014, Jakub Jelinek wrote: > Hi! > > As discussed on IRC, this patch introduces two new attributes, > so that the C library (and other headers) have a way to > a) tell the compiler something about functions like aligned_alloc >or memalign > b) tell the compiler the alignment of

Re: [PATCH] Add alloc_align and assume_aligned attributes (PR middle-end/60092)

2014-02-06 Thread Marc Glisse
On Thu, 6 Feb 2014, Jakub Jelinek wrote: +/* Handle a "alloc_align" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_alloc_align_attribute (tree *node, tree ARG_UNUSED (name), tree args, + int, bool *no_add_attrs) +{ + unsigned

[PATCH] Add alloc_align and assume_aligned attributes (PR middle-end/60092)

2014-02-06 Thread Jakub Jelinek
Hi! As discussed on IRC, this patch introduces two new attributes, so that the C library (and other headers) have a way to a) tell the compiler something about functions like aligned_alloc or memalign b) tell the compiler the alignment of pointers returned say by malloc Ok for trunk if bootstr