Re: PING #2 [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2019-01-16 Thread Jeff Law
On 1/15/19 9:31 AM, Martin Sebor wrote: > Ping: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00337.html > > Jeff, do you have any more questions/concerns or is this patch > good to commit? I think both Jakub and I were concerned about handling expressions in this code. I don't recall a resolutio

Re: PING #2 [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2019-01-15 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00337.html Jeff, do you have any more questions/concerns or is this patch good to commit? Martin On 1/7/19 5:32 PM, Martin Sebor wrote: Ping: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00337.html On 1/3/19 3:22 PM, Martin Sebor wrote: Pi

PING #2 [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2019-01-07 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00337.html On 1/3/19 3:22 PM, Martin Sebor wrote: Ping: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00337.html On 12/20/18 7:51 PM, Martin Sebor wrote: Jeff, did this and the rest of the discussion answer your question and if so, is the pat

PING [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2019-01-03 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00337.html On 12/20/18 7:51 PM, Martin Sebor wrote: Jeff, did this and the rest of the discussion answer your question and if so, is the patch okay to commit?   https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00337.html Martin On 12/13/18 12:

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-20 Thread Martin Sebor
Jeff, did this and the rest of the discussion answer your question and if so, is the patch okay to commit? https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00337.html Martin On 12/13/18 12:48 PM, Martin Sebor wrote: On 12/13/18 12:20 PM, Martin Sebor wrote: On 12/13/18 11:59 AM, Jeff Law wrote

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-14 Thread Martin Sebor
the manual a function declaration like __attribute__ ((alloc_size (1), malloc)) void* allocate (unsigned); should have those two attributes applied to it. Yet, alloc_size is actually applied to its type (but not to its decl) while malloc to the function's decl but not its type (bug 88397)

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-13 Thread Jakub Jelinek
On Thu, Dec 13, 2018 at 09:03:57PM -0700, Martin Sebor wrote: > It's as good as the design of GCC attributes allows. Based on No. > the manual a function declaration like > > __attribute__ ((alloc_size (1), malloc)) > void* allocate (unsigned); > > should have those two attributes applied

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-13 Thread Martin Sebor
On 12/13/18 4:39 PM, Jakub Jelinek wrote: On Thu, Dec 13, 2018 at 02:05:29PM -0700, Martin Sebor wrote: So how is the builtin defined then? Is the argument always an expression and you only return whether its type has the attribute, or do something different if the expression is of certain kind

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-13 Thread Jakub Jelinek
On Thu, Dec 13, 2018 at 02:05:29PM -0700, Martin Sebor wrote: > > So how is the builtin defined then? Is the argument always an expression > > and you only return whether its type has the attribute, or do something > > different if the expression is of certain kind? > > For a DECL the built-in lo

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-13 Thread Martin Sebor
On 12/13/18 12:56 PM, Jakub Jelinek wrote: On Thu, Dec 13, 2018 at 12:48:18PM -0700, Martin Sebor wrote: The support is necessary in order to determine the attributes in expressions such as:   struct S { __attribute__ ((packed)) int a[32]; };   extern struct S s;   _Static_assert (__bui

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-13 Thread Jakub Jelinek
On Thu, Dec 13, 2018 at 12:48:18PM -0700, Martin Sebor wrote: > > The support is necessary in order to determine the attributes > > in expressions such as: > > > >   struct S { __attribute__ ((packed)) int a[32]; }; > > > >   extern struct S s; > > > >   _Static_assert (__builtin_has_attribut

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-13 Thread Martin Sebor
On 12/13/18 12:20 PM, Martin Sebor wrote: On 12/13/18 11:59 AM, Jeff Law wrote: On 12/5/18 8:55 PM, Martin Sebor wrote: The __builtin_has_attribute function fails with an ICE when its first argument is an expression such as INDIRECT_REF, or many others.  The code simply assumes it's either a ty

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-13 Thread Martin Sebor
On 12/13/18 11:59 AM, Jeff Law wrote: On 12/5/18 8:55 PM, Martin Sebor wrote: The __builtin_has_attribute function fails with an ICE when its first argument is an expression such as INDIRECT_REF, or many others.  The code simply assumes it's either a type or a decl.  The attached patch corrects 

Re: [PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-13 Thread Jeff Law
On 12/5/18 8:55 PM, Martin Sebor wrote: > The __builtin_has_attribute function fails with an ICE when > its first argument is an expression such as INDIRECT_REF, or > many others.  The code simply assumes it's either a type or > a decl.  The attached patch corrects this oversight. > > While testin

[PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-05 Thread Martin Sebor
The __builtin_has_attribute function fails with an ICE when its first argument is an expression such as INDIRECT_REF, or many others. The code simply assumes it's either a type or a decl. The attached patch corrects this oversight. While testing the fix I also noticed the C++ front end expects