This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] ICF: handle correctly hard register variables


Hello.

This patch adds support for hard register variables in ICF and it's pre-approved
by Honza, I'm going to install the patch.

No regressing on x86_64-linux-pc.

Thanks,
Martin

>From eff93050904e0aeaf26b47fb1d1e8eeb803f9af6 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Wed, 25 Feb 2015 18:26:09 +0100
Subject: [PATCH] ICF: Validate correctly hard register variables.

gcc/ChangeLog:

2015-02-25  Martin Liska  <mliska@suse.cz>

	* ipa-icf-gimple.c (func_checker::compare_variable_decl): Compare
	hard register variables.
---
 gcc/ipa-icf-gimple.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c
index 5b176d0..53d2c38 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);
-- 
2.1.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]