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 e60da6e..50b9032 100644 (file)
@@ -1,5 +1,10 @@
 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
        default constructor.
        * ipa-icf.c (sem_function::init): Make operand_equal_p
index edb8fd6..ac53a1d 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;
     }