From: Martin Liska Date: Wed, 25 Feb 2015 17:38:09 +0000 (+0100) Subject: ICF: Validate correctly hard register variables. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b4f26d91afba1a109af95cc69e2d0a0064292335;p=gcc.git ICF: Validate correctly hard register variables. * ipa-icf-gimple.c (func_checker::compare_variable_decl): Compare hard register variables. From-SVN: r220985 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c9270c80d15..4d231c3a5ba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-02-25 Martin Liska + + * ipa-icf-gimple.c (func_checker::compare_variable_decl): Compare + hard register variables. + 2015-02-25 Kai Tietz PR target/64212 diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index 5b176d019d7..53d2c38bc9f 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -575,6 +575,13 @@ func_checker::compare_variable_decl (tree t1, tree t2) if (t1 == t2) return true; + if (DECL_HARD_REGISTER (t1) != DECL_HARD_REGISTER (t2)) + return return_false_with_msg ("DECL_HARD_REGISTER are different"); + + if (DECL_HARD_REGISTER (t1) + && DECL_ASSEMBLER_NAME (t1) != DECL_ASSEMBLER_NAME (t2)) + return return_false_with_msg ("HARD REGISTERS are different"); + if (TREE_CODE (t1) == VAR_DECL && (DECL_EXTERNAL (t1) || TREE_STATIC (t1))) { symtab_node *n1 = symtab_node::get (t1);