This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Clean up attribute value comparison in lto-symtab.c.
- From: Martin Liška <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 11 Apr 2018 11:26:26 +0200
- Subject: [PATCH] Clean up attribute value comparison in lto-symtab.c.
Hi.
This is a small clean-up which Jakub suggested.
Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
Ready to be installed?
Martin
gcc/lto/ChangeLog:
2018-04-11 Martin Liska <mliska@suse.cz>
* lto-symtab.c (lto_symtab_merge_p): Use attribute_value_equal
function.
---
gcc/lto/lto-symtab.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 37c4f45eb0b..2660542300e 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -580,9 +580,7 @@ lto_symtab_merge_p (tree prevailing, tree decl)
tree prev_attr = lookup_attribute ("error", DECL_ATTRIBUTES (prevailing));
tree attr = lookup_attribute ("error", DECL_ATTRIBUTES (decl));
if ((prev_attr == NULL) != (attr == NULL)
- || (prev_attr
- && TREE_VALUE (TREE_VALUE (prev_attr))
- != TREE_VALUE (TREE_VALUE (attr))))
+ || (prev_attr && !attribute_value_equal (prev_attr, attr)))
{
if (symtab->dump_file)
fprintf (symtab->dump_file, "Not merging decls; "
@@ -593,9 +591,7 @@ lto_symtab_merge_p (tree prevailing, tree decl)
prev_attr = lookup_attribute ("warning", DECL_ATTRIBUTES (prevailing));
attr = lookup_attribute ("warning", DECL_ATTRIBUTES (decl));
if ((prev_attr == NULL) != (attr == NULL)
- || (prev_attr
- && TREE_VALUE (TREE_VALUE (prev_attr))
- != TREE_VALUE (TREE_VALUE (attr))))
+ || (prev_attr && !attribute_value_equal (prev_attr, attr)))
{
if (symtab->dump_file)
fprintf (symtab->dump_file, "Not merging decls; "