On Wed, Sep 04, 2024 at 02:05:21PM -0700, Andrew Pinski wrote:
> The code in aarch64_lookup_shared_state_flags all C++11 attributes on the 
> function type
> had a namespace associated with them. But with the addition of 
> reproducible/unsequenced,
> this was no longer true.
> This is the simple fix to ignore attributes in the global namespace since we 
> are looking
> for ones in the `arm` namespace instead.
> 
> Built and tested for aarch64-linux-gnu.
> 
> gcc/ChangeLog:
> 
>       * config/aarch64/aarch64.cc (aarch64_lookup_shared_state_flags): Ignore
>       attributes in the global namespace.
> 
> Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>
> ---
>  gcc/config/aarch64/aarch64.cc | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
> index 27e24ba70ab..3f7bc572edc 100644
> --- a/gcc/config/aarch64/aarch64.cc
> +++ b/gcc/config/aarch64/aarch64.cc
> @@ -597,6 +597,10 @@ aarch64_lookup_shared_state_flags (tree attrs, const 
> char *state_name)
>        if (!cxx11_attribute_p (attr))
>       continue;
>  
> +      /* Skip the attributes in the global namespace. */
> +      if (!TREE_PURPOSE (TREE_PURPOSE (attr)))
> +     continue;
> +
>        auto ns = IDENTIFIER_POINTER (TREE_PURPOSE (TREE_PURPOSE (attr)));
>        if (strcmp (ns, "arm") != 0)
>       continue;

Take it or leave it, but I think the whole thing could be just

  tree ns = get_attribute_namespace (attr);
  if (!ns || !id_equal (ns, "arm"))
    continue;

You could also use get_attribute_name below for attr_name.

Marek

Reply via email to