aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2025-12-06 11:08:05 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2025-12-06 11:08:05 +0100
commitc57188ef0c10fefc408a67b9c3db877e7dcde29e (patch)
treeea55387eaee0755bfce37795fb918e1fd16c7e48 /gcc
parent3b7e865779d03b4d29375a3c28dfaa2172eced4a (diff)
downloadgcc-c57188ef0c10fefc408a67b9c3db877e7dcde29e.zip
gcc-c57188ef0c10fefc408a67b9c3db877e7dcde29e.tar.gz
gcc-c57188ef0c10fefc408a67b9c3db877e7dcde29e.tar.bz2
attribs: Use attribute_value_equal in decl_attributes
This is another thing discussed in the 1/9 Reflection thread, also not dependent on reflection. decl_attributes calls simple_cst_equal on TREE_VALUEs of the current and preexisting attributes, but that is just a small part of how attribute values should be compared. The following patch fixes that. 2025-12-06 Jakub Jelinek <jakub@redhat.com> * attribs.cc (decl_attributes): Use attribute_value_equal to compare attribute values instead of simple_cst_equal.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/attribs.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/attribs.cc b/gcc/attribs.cc
index 7d7f8f3..51c7f46 100644
--- a/gcc/attribs.cc
+++ b/gcc/attribs.cc
@@ -967,10 +967,8 @@ decl_attributes (tree *node, tree attributes, int flags,
for (a = find_same_attribute (attr, old_attrs);
a != NULL_TREE;
a = find_same_attribute (attr, TREE_CHAIN (a)))
- {
- if (simple_cst_equal (TREE_VALUE (a), args) == 1)
- break;
- }
+ if (attribute_value_equal (a, attr))
+ break;
if (a == NULL_TREE)
{