On 12/6/25 3:31 PM, Jakub Jelinek wrote:
Hi!
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.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
OK.
2025-12-06 Jakub Jelinek <[email protected]>
* attribs.cc (decl_attributes): Use attribute_value_equal to
compare attribute values instead of simple_cst_equal.
--- gcc/attribs.cc.jj 2025-10-03 10:05:55.889897385 +0200
+++ gcc/attribs.cc 2025-12-05 22:28:06.722059786 +0100
@@ -967,10 +967,8 @@ decl_attributes (tree *node, tree attrib
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)
{
Jakub