[4/5] Handle FIELD_DECL in IPA ICF.
diff mbox series

Message ID 8fe6b96e1dea77e3af48fd1192699df9d6841b11.1573636740.git.mliska@suse.cz
State New
Headers show
Series
  • IPA ICF: more clean up
Related show

Commit Message

Martin Liška Nov. 8, 2019, 10:01 a.m. UTC
gcc/ChangeLog:

2019-11-11  Martin Liska  <mliska@suse.cz>

	* ipa-icf-gimple.c (func_checker::hash_operand): Improve
	func_checker::hash_operand by handling of FIELD_DECLs.
---
 gcc/ipa-icf-gimple.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Jeff Law Nov. 13, 2019, 7:52 p.m. UTC | #1
On 11/8/19 3:01 AM, Martin Liska wrote:
> 
> gcc/ChangeLog:
> 
> 2019-11-11  Martin Liska  <mliska@suse.cz>
> 
> 	* ipa-icf-gimple.c (func_checker::hash_operand): Improve
> 	func_checker::hash_operand by handling of FIELD_DECLs.
OK
jeff

Patch
diff mbox series

diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c
index edb8fd66e08..ac53a1dfbbf 100644
--- a/gcc/ipa-icf-gimple.c
+++ b/gcc/ipa-icf-gimple.c
@@ -234,7 +234,10 @@  func_checker::hash_operand (const_tree arg, inchash::hash &hstate,
     case CONST_DECL:
     case SSA_NAME:
       return;
-
+    case FIELD_DECL:
+      inchash::add_expr (DECL_FIELD_OFFSET (arg), hstate, flags);
+      inchash::add_expr (DECL_FIELD_BIT_OFFSET (arg), hstate, flags);
+      return;
     default:
       break;
     }