summaryrefslogtreecommitdiff
path: root/0236-Backport-SME-attribs-Namespace-aware-lookup_attribut.patch
diff options
context:
space:
mode:
Diffstat (limited to '0236-Backport-SME-attribs-Namespace-aware-lookup_attribut.patch')
-rw-r--r--0236-Backport-SME-attribs-Namespace-aware-lookup_attribut.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/0236-Backport-SME-attribs-Namespace-aware-lookup_attribut.patch b/0236-Backport-SME-attribs-Namespace-aware-lookup_attribut.patch
new file mode 100644
index 0000000..f7a909f
--- /dev/null
+++ b/0236-Backport-SME-attribs-Namespace-aware-lookup_attribut.patch
@@ -0,0 +1,58 @@
+From dbe5a29054d4eb1e0f5173c8f2291569eac71c96 Mon Sep 17 00:00:00 2001
+From: Richard Sandiford <richard.sandiford@arm.com>
+Date: Sat, 2 Dec 2023 13:49:55 +0000
+Subject: [PATCH 137/157] [Backport][SME] attribs: Namespace-aware
+ lookup_attribute_spec
+
+Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=df4643f90c45db2501c731d4fded60dc1426b484
+
+attribute_ignored_p already used a namespace-aware query
+to find the attribute_spec for an existing attribute:
+
+ const attribute_spec *as = lookup_attribute_spec (TREE_PURPOSE (attr));
+
+This patch does the same for other callers in the file.
+
+gcc/
+ * attribs.cc (comp_type_attributes): Pass the full TREE_PURPOSE
+ to lookup_attribute_spec, rather than just the name.
+ (remove_attributes_matching): Likewise.
+---
+ gcc/attribs.cc | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/attribs.cc b/gcc/attribs.cc
+index 8e2696bc5..1dbc30a95 100644
+--- a/gcc/attribs.cc
++++ b/gcc/attribs.cc
+@@ -1417,7 +1417,7 @@ comp_type_attributes (const_tree type1, const_tree type2)
+ const struct attribute_spec *as;
+ const_tree attr;
+
+- as = lookup_attribute_spec (get_attribute_name (a));
++ as = lookup_attribute_spec (TREE_PURPOSE (a));
+ if (!as || as->affects_type_identity == false)
+ continue;
+
+@@ -1431,7 +1431,7 @@ comp_type_attributes (const_tree type1, const_tree type2)
+ {
+ const struct attribute_spec *as;
+
+- as = lookup_attribute_spec (get_attribute_name (a));
++ as = lookup_attribute_spec (TREE_PURPOSE (a));
+ if (!as || as->affects_type_identity == false)
+ continue;
+
+@@ -1473,8 +1473,7 @@ remove_attributes_matching (tree attrs, Predicate predicate)
+ const_tree start = attrs;
+ for (const_tree attr = attrs; attr; attr = TREE_CHAIN (attr))
+ {
+- tree name = get_attribute_name (attr);
+- const attribute_spec *as = lookup_attribute_spec (name);
++ const attribute_spec *as = lookup_attribute_spec (TREE_PURPOSE (attr));
+ const_tree end;
+ if (!predicate (attr, as))
+ end = attr;
+--
+2.33.0
+