]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Use is_attribute_namespace_p and get_attribute_name inside aarch64_lookup_sh...
authorAndrew Pinski <quic_apinski@quicinc.com>
Wed, 4 Sep 2024 16:06:53 +0000 (09:06 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Fri, 6 Sep 2024 12:48:46 +0000 (05:48 -0700)
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 is not true.

This fixes the issue by using is_attribute_namespace_p instead of manually figuring out
the namespace is named "arm" and uses get_attribute_name instead of manually grabbing
the attribute name.

Built and tested for aarch64-linux-gnu.

gcc/ChangeLog:

PR target/116598
* config/aarch64/aarch64.cc (aarch64_lookup_shared_state_flags): Use
is_attribute_namespace_p and get_attribute_name instead of manually grabbing
the namespace and name of the attribute.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/config/aarch64/aarch64.cc

index 27e24ba70abe3837d54bd2e7fa65d444054f8809..6a3f1a23a9f435b88e1d2d22da909e5423321940 100644 (file)
@@ -594,14 +594,10 @@ aarch64_lookup_shared_state_flags (tree attrs, const char *state_name)
 {
   for (tree attr = attrs; attr; attr = TREE_CHAIN (attr))
     {
-      if (!cxx11_attribute_p (attr))
+      if (!is_attribute_namespace_p ("arm", attr))
        continue;
 
-      auto ns = IDENTIFIER_POINTER (TREE_PURPOSE (TREE_PURPOSE (attr)));
-      if (strcmp (ns, "arm") != 0)
-       continue;
-
-      auto attr_name = IDENTIFIER_POINTER (TREE_VALUE (TREE_PURPOSE (attr)));
+      auto attr_name = IDENTIFIER_POINTER (get_attribute_name (attr));
       auto flags = aarch64_attribute_shared_state_flags (attr_name);
       if (!flags)
        continue;