From aade59afd28a6005c26d042ba56e9b9af32e99fa Mon Sep 17 00:00:00 2001 From: marxin Date: Wed, 11 Apr 2018 10:33:46 +0000 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259312 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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 75a1d1ca807..d2b2511710c 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 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; " -- 2.11.4.GIT