Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-11-12 Thread Martin Sebor
On 11/12/2018 11:29 AM, Matthew Malcomson wrote: Hello Martin, The new testcase Wattribute-alias.c fails on targets without ifunc support (e.g. aarch64-none-elf cross-build). It seems that just adding a directive `{ dg-require-ifunc "" }` to the test file changes the test to unsupported instead

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-11-12 Thread Matthew Malcomson
Hello Martin, The new testcase Wattribute-alias.c fails on targets without ifunc support (e.g. aarch64-none-elf cross-build). It seems that just adding a directive `{ dg-require-ifunc "" }` to the test file changes the test to unsupported instead of having a fail. I don't know much about this

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-11-09 Thread Martin Sebor
+/* Handle the "copy" attribute by copying the set of attributes + from the symbol referenced by ARGS to the declaration of *NODE. */ + +static tree +handle_copy_attribute (tree *node, tree name, tree args, + int flags, bool *no_add_attrs) +{ + /* Break cycles in circular

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-11-07 Thread Jeff Law
On 10/23/18 7:50 PM, Martin Sebor wrote: > On 10/23/2018 03:53 PM, Joseph Myers wrote: >> On Mon, 22 Oct 2018, Martin Sebor wrote: >> >>> between aliases and ifunc resolvers.  With -Wattribute-alias=1 >>> that reduced the number of unique instances of the warnings for >>> a Glibc build to just 27. 

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-31 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2018-10/msg01481.html There was quite a bit of discussion between Joseph and me about the Glibc changes needed to take advantage of the solution but the GCC patch itself (above) still needs reviewing/approval. Other than some (minor) changes to the C++ fr

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-24 Thread Martin Sebor
On 10/24/2018 11:27 AM, Joseph Myers wrote: On Wed, 24 Oct 2018, Martin Sebor wrote: On 10/24/2018 06:22 AM, Joseph Myers wrote: On Wed, 24 Oct 2018, Martin Sebor wrote: But if you do want to avoid the attribute on declarations of these functions regardless it should be safe to add it after

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-24 Thread Joseph Myers
On Wed, 24 Oct 2018, Martin Sebor wrote: > On 10/24/2018 06:22 AM, Joseph Myers wrote: > > On Wed, 24 Oct 2018, Martin Sebor wrote: > > > > > But if you do want to avoid the attribute on declarations of > > > these functions regardless it should be safe to add it after > > > the declaration in th

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-24 Thread Martin Sebor
On 10/24/2018 06:24 AM, Joseph Myers wrote: On Wed, 24 Oct 2018, Martin Sebor wrote: /* The compiler will optimize based on the knowledge the parameter is not NULL. This will omit tests. A robust implementation cannot allow this so when compiling glibc itself we ignore this attribute.

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-24 Thread Martin Sebor
On 10/24/2018 06:22 AM, Joseph Myers wrote: On Wed, 24 Oct 2018, Martin Sebor wrote: But if you do want to avoid the attribute on declarations of these functions regardless it should be safe to add it after the declaration in the .c file, like so: __hidden_ver1 (strcmp, __GI_strcmp, __redirect

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-24 Thread Joseph Myers
On Wed, 24 Oct 2018, Martin Sebor wrote: > /* The compiler will optimize based on the knowledge the parameter is >not NULL. This will omit tests. A robust implementation cannot allow >this so when compiling glibc itself we ignore this attribute. */ > # undef __nonnull > # define __nonnu

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-24 Thread Joseph Myers
On Wed, 24 Oct 2018, Martin Sebor wrote: > But if you do want to avoid the attribute on declarations of > these functions regardless it should be safe to add it after > the declaration in the .c file, like so: > > __hidden_ver1 (strcmp, __GI_strcmp, __redirect_strcmp) > __attribute__ ((visibili

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-23 Thread Martin Sebor
On 10/23/2018 03:53 PM, Joseph Myers wrote: On Mon, 22 Oct 2018, Martin Sebor wrote: between aliases and ifunc resolvers. With -Wattribute-alias=1 that reduced the number of unique instances of the warnings for a Glibc build to just 27. Of those, all but one of the -Wattributes instances are

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-23 Thread Joseph Myers
On Mon, 22 Oct 2018, Martin Sebor wrote: > between aliases and ifunc resolvers. With -Wattribute-alias=1 > that reduced the number of unique instances of the warnings for > a Glibc build to just 27. Of those, all but one of > the -Wattributes instances are of the form: > > warning: ‘leaf’ att

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-22 Thread Martin Sebor
On 10/01/2018 05:00 PM, Joseph Myers wrote: On Mon, 1 Oct 2018, Martin Sebor wrote: Testing the patch with Glibc triggers thousands of warnings of both kinds. After reviewing a small subset it became apparent Thousands of warnings suggests initially having the warning outside -Wall (though o

Re: [PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-01 Thread Joseph Myers
On Mon, 1 Oct 2018, Martin Sebor wrote: > Testing the patch with Glibc triggers thousands of warnings of > both kinds. After reviewing a small subset it became apparent Thousands of warnings suggests initially having the warning outside -Wall (though one might hope to move it into -Wall at some

[PATCH] detect attribute mismatches in alias declarations (PR 81824)

2018-10-01 Thread Martin Sebor
PR 81824 is a request to detect and diagnose alias declarations with less restrictive attributes than those of their targets. I promised I'd implement this for GCC 9 so with the end of stage 1 approaching I figured it was about time to post my attempt at this enhancement. I expect it to need twea