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.
This commit is contained in:
Jakub Jelinek
2025-12-06 11:08:05 +01:00
committed by Jakub Jelinek
parent 3b7e865779
commit c57188ef0c

View File

@@ -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)
{