From 23d87577a3a02b11858c7de68313ebcc45445a13 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 11 Apr 2018 12:33:46 +0200 Subject: [PATCH] Clean up attribute value comparison in lto-symtab.c. 2018-04-11 Martin Liska * lto-symtab.c (lto_symtab_merge_p): Use attribute_value_equal function. From-SVN: r259312 --- gcc/lto/ChangeLog | 5 +++++ gcc/lto/lto-symtab.c | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 75a1d1c..d2b2511 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2018-04-11 Martin Liska + + * lto-symtab.c (lto_symtab_merge_p): Use attribute_value_equal + function. + 2018-04-10 Martin Liska PR lto/85248 diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index 37c4f45..2660542 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; " -- 2.7.4