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

Martin Sebor msebor@gmail.com
Mon Nov 12 18:38:00 GMT 2018


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 of having a fail.
>
> I don't know much about this patch so I don't know if the non-ifunc
> checks would still be useful on such targets.
>
> Would the simple change be OK? or would it be best to split the test
> file into multiple parts to still run the other checks?

I just committed the former change earlier today but splitting
the test would have probably been a better way to go.  Thanks
for reporting it just the same!  If you would prefer to split
the test that would be fine with me.

Martin

> Regards,
> Matthew
>
>
> On 09/11/18 17:33, Martin Sebor wrote:
>>>> +/* 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 references.  */
>>>> +  static hash_set<tree> attr_copy_visited;
>>> Does this really need to be static?
>>
>> The variable was intended to break cycles in recursive calls to
>> the function for self-referential applications of attribute copy
>> but since the attribute itself is not applied (anymore) such cycles
>> can no longer form.  I have removed the variable and simplified
>> the handlers (there are tests to verify this works correctly).
>>
>>>> diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
>>>> index cfe6a8e..8ffb0cd 100644
>>>> --- a/gcc/doc/extend.texi
>>>> +++ b/gcc/doc/extend.texi
>>>> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
>>>> index 5c95f67..c027acd 100644
>>>> --- a/gcc/doc/invoke.texi
>>>> +++ b/gcc/doc/invoke.texi
>>> [ ... ]
>>>
>>>> +
>>>> +In C++, the warning is issued when an explicitcspecialization of a
>>>> primary
>>> "explicitcspecialization" ? :-)
>>>
>>
>> Fixed.
>>
>>>
>>> Looks pretty good.  There's the explicit specialization nit and the
>>> static vs auto question for attr_copy_visited.  Otherwise it's OK.
>>
>> Thanks.  I've retested a revision with the changes discussed here
>> and committed it as r265980.
>>
>> Martin
>



More information about the Gcc-patches mailing list