Handle FIELD_DECL in IPA ICF.
authorMartin Liska <mliska@suse.cz>
Thu, 14 Nov 2019 08:35:35 +0000 (09:35 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 14 Nov 2019 08:35:35 +0000 (08:35 +0000)
2019-11-14  Martin Liska  <mliska@suse.cz>

* ipa-icf-gimple.c (func_checker::hash_operand): Improve
func_checker::hash_operand by handling of FIELD_DECLs.

From-SVN: r278208

gcc/ChangeLog
gcc/ipa-icf-gimple.c

index e60da6e03227b399a308042b05c16d5b5620baea..50b9032365b6bef46237fd321f90098b8409eb54 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-14  Martin Liska  <mliska@suse.cz>
+
+       * ipa-icf-gimple.c (func_checker::hash_operand): Improve
+       func_checker::hash_operand by handling of FIELD_DECLs.
+
 2019-11-14  Martin Liska  <mliska@suse.cz>
 
        * ipa-icf-gimple.h (func_checker::func_checker): Add
index edb8fd66e08abdf8b903522de8373556a5db225d..ac53a1dfbbf4b6a0f3ae5689d81bccc4c10e577b 100644 (file)
@@ -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;
     }