Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2018-04-05 Thread Jakub Jelinek
On Thu, Apr 05, 2018 at 09:01:02AM +0200, Andreas Krebbel wrote: > > Wouldn't it be better to just use aligned (8) and aligned (16) instead of > > aligned (4) and aligned (8)? > > aligned (8) does not trigger the warning anymore. Neither on s390 nor on > x86. I don't think there > is a way to

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2018-04-05 Thread Andreas Krebbel
On 04/04/2018 07:34 PM, Jakub Jelinek wrote: > On Wed, Apr 04, 2018 at 06:51:00PM +0200, Andreas Krebbel wrote: >>> On targets enforcing a function alignment bigger than 4 bytes this triggers >>> an error instead: >>> >>> +inline int ATTR ((aligned (4))) >>> +finline_hot_noret_align (int); /* {

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2018-04-04 Thread Jakub Jelinek
On Wed, Apr 04, 2018 at 06:51:00PM +0200, Andreas Krebbel wrote: > > On targets enforcing a function alignment bigger than 4 bytes this triggers > > an error instead: > > > > +inline int ATTR ((aligned (4))) > > +finline_hot_noret_align (int); /* { dg-warning "ignoring attribute > > .aligned

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2018-04-04 Thread Martin Sebor
On 04/04/2018 10:51 AM, Andreas Krebbel wrote: On 04/04/2018 06:16 PM, Andreas Krebbel wrote: On 10/03/2017 12:23 AM, Jeff Law wrote: On 09/20/2017 12:04 PM, Martin Sebor wrote: On 09/19/2017 03:00 PM, Joseph Myers wrote: On Tue, 19 Sep 2017, Martin Sebor wrote: In general, the data

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2018-04-04 Thread Andreas Krebbel
On 04/04/2018 06:16 PM, Andreas Krebbel wrote: > On 10/03/2017 12:23 AM, Jeff Law wrote: >> On 09/20/2017 12:04 PM, Martin Sebor wrote: >>> On 09/19/2017 03:00 PM, Joseph Myers wrote: On Tue, 19 Sep 2017, Martin Sebor wrote: >> In general, the data structures where you need to ensure 

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2018-04-04 Thread Andreas Krebbel
On 10/03/2017 12:23 AM, Jeff Law wrote: > On 09/20/2017 12:04 PM, Martin Sebor wrote: >> On 09/19/2017 03:00 PM, Joseph Myers wrote: >>> On Tue, 19 Sep 2017, Martin Sebor wrote: >>> > In general, the data structures where you need to ensure manually that if > > attribute A is listed in 

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-10-02 Thread Jeff Law
On 09/20/2017 12:04 PM, Martin Sebor wrote: > On 09/19/2017 03:00 PM, Joseph Myers wrote: >> On Tue, 19 Sep 2017, Martin Sebor wrote: >> In general, the data structures where you need to ensure manually that if attribute A is listed in EXCL for B, then attribute B is also listed in

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-09-20 Thread Martin Sebor
On 09/19/2017 03:00 PM, Joseph Myers wrote: On Tue, 19 Sep 2017, Martin Sebor wrote: In general, the data structures where you need to ensure manually that if attribute A is listed in EXCL for B, then attribute B is also listed in EXCL for A, seem concerning. I'd expect either data structures

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-09-19 Thread Joseph Myers
On Tue, 19 Sep 2017, Martin Sebor wrote: > > In general, the data structures where you need to ensure manually that if > > attribute A is listed in EXCL for B, then attribute B is also listed in > > EXCL for A, seem concerning. I'd expect either data structures that make > > such asymmetry

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-09-19 Thread Martin Sebor
On 09/12/2017 11:06 AM, Jeff Law wrote: On 08/17/2017 10:03 AM, Martin Sebor wrote: First, there is the risk that someone will write code based on the pure declaration even if there's no intervening call to the function between it and the const one. Code tends to be sloppy, and it's also not

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-09-19 Thread Martin Sebor
On 09/06/2017 05:30 PM, Joseph Myers wrote: On Thu, 17 Aug 2017, Martin Sebor wrote: +/* Check LAST_DECL and NODE of the same symbol for attributes that are + recorded in EXCL to be mutually exclusive with ATTRNAME, diagnose + them, and return true if any have been found. NODE can be a

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-09-12 Thread Jeff Law
On 08/17/2017 10:03 AM, Martin Sebor wrote: > > First, there is the risk that someone will write code based > on the pure declaration even if there's no intervening call > to the function between it and the const one. Code tends to > be sloppy, and it's also not uncommon to declare the same >

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-09-12 Thread Jeff Law
On 08/09/2017 01:55 PM, Joseph Myers wrote: > On Wed, 9 Aug 2017, Martin Sebor wrote: > >> the same function with the other of this pair attributes. I'd >> also be okay with not diagnosing this combination if I could >> convince myself that it's safe (or can be made safe) and treated >>

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-09-12 Thread Jeff Law
On 08/10/2017 03:55 PM, Joseph Myers wrote: > On Wed, 9 Aug 2017, Martin Sebor wrote: > >> The problem isn't that the declarations aren't merged at the call >> site but rather that the middle-end gives const precedence over >> pure so when both attributes are provided the former wins. > > But

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-09-06 Thread Joseph Myers
On Thu, 17 Aug 2017, Martin Sebor wrote: > +/* Check LAST_DECL and NODE of the same symbol for attributes that are > + recorded in EXCL to be mutually exclusive with ATTRNAME, diagnose > + them, and return true if any have been found. NODE can be a DECL > + or a TYPE. */ > + > +static

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-28 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01087.html On 08/24/2017 02:43 PM, Martin Sebor wrote: The bulk of this patch touches what I think is considered the middle-end (attribs.c) so let me include its maintainers, Ian, Jeff, and Richard:

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-24 Thread Martin Sebor
The bulk of this patch touches what I think is considered the middle-end (attribs.c) so let me include its maintainers, Ian, Jeff, and Richard: https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01087.html The high-level description and rationale for the change are here:

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-17 Thread Martin Sebor
Attached is an updated patch with just the minor editorial tweaks for the issues pointed out by Marek (stray comments and spaces), and with the C++ and libstdc++ bits removed and posted separately. I also added some text to the manual to clarify the const/pure effects. I thought quite a bit

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-11 Thread Joseph Myers
On Fri, 11 Aug 2017, Martin Sebor wrote: > > (An optional warning for different information in different declarations > > is reasonable enough. Actually in glibc it would be useful to have a > > warning for a different but related case - two functions both declared, > > later one defined as an

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-11 Thread Martin Sebor
On 08/10/2017 03:55 PM, Joseph Myers wrote: On Wed, 9 Aug 2017, Martin Sebor wrote: The problem isn't that the declarations aren't merged at the call site but rather that the middle-end gives const precedence over pure so when both attributes are provided the former wins. But that precedence

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-10 Thread Joseph Myers
On Wed, 9 Aug 2017, Martin Sebor wrote: > The problem isn't that the declarations aren't merged at the call > site but rather that the middle-end gives const precedence over > pure so when both attributes are provided the former wins. But that precedence is correct. Any function with the

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-09 Thread Martin Sebor
On 08/09/2017 01:55 PM, Joseph Myers wrote: On Wed, 9 Aug 2017, Martin Sebor wrote: the same function with the other of this pair attributes. I'd also be okay with not diagnosing this combination if I could convince myself that it's safe (or can be made safe) and treated consistently. I'd

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-09 Thread Joseph Myers
On Wed, 9 Aug 2017, Martin Sebor wrote: > the same function with the other of this pair attributes. I'd > also be okay with not diagnosing this combination if I could > convince myself that it's safe (or can be made safe) and treated > consistently. I'd expect it to be safe; it might simply

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-09 Thread Martin Sebor
On 08/09/2017 11:13 AM, Joseph Myers wrote: On Wed, 9 Aug 2017, Martin Sebor wrote: diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c index 146b76c..58a4742 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c +++

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-09 Thread Joseph Myers
On Wed, 9 Aug 2017, Martin Sebor wrote: > > > diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c > > > b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c > > > index 146b76c..58a4742 100644 > > > --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c > > > +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c >

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-09 Thread Martin Sebor
On 08/09/2017 05:53 AM, Marek Polacek wrote: (Not a proper review really.) On Tue, Aug 08, 2017 at 10:13:07AM -0600, Martin Sebor wrote: @@ -490,7 +583,9 @@ decl_attributes (tree *node, tree attributes, int flags) | (int) ATTR_FLAG_ARRAY_NEXT)) {

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2017-08-09 Thread Marek Polacek
(Not a proper review really.) On Tue, Aug 08, 2017 at 10:13:07AM -0600, Martin Sebor wrote: > @@ -490,7 +583,9 @@ decl_attributes (tree *node, tree attributes, int flags) > | (int) ATTR_FLAG_ARRAY_NEXT)) > { > /* Pass on this attribute to be tried again.