Always compare types of LHS for gimple_assign in ICF.
authorMartin Liska <mliska@suse.cz>
Tue, 18 Feb 2020 14:07:06 +0000 (15:07 +0100)
committerMartin Liska <mliska@suse.cz>
Tue, 18 Feb 2020 14:07:06 +0000 (15:07 +0100)
PR ipa/92518
* ipa-icf-gimple.c (func_checker::compare_gimple_assign):
Always compare LHS of gimple_assign.

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

index b4b4942..c107f19 100644 (file)
@@ -1,5 +1,11 @@
 2020-02-18  Martin Liska  <mliska@suse.cz>
 
+       PR ipa/92518
+       * ipa-icf-gimple.c (func_checker::compare_gimple_assign):
+       Always compare LHS of gimple_assign.
+
+2020-02-18  Martin Liska  <mliska@suse.cz>
+
        PR ipa/93583
        * cgraph.c (cgraph_node::verify_node): Verify MALLOC attribute
        and return type of functions.
index fa71a02..3e5b2d4 100644 (file)
@@ -620,8 +620,8 @@ func_checker::compare_gimple_assign (gimple *s1, gimple *s2)
       arg1 = gimple_op (s1, i);
       arg2 = gimple_op (s2, i);
 
-      /* LHS types of NOP_EXPR must be compatible.  */
-      if (CONVERT_EXPR_CODE_P (code1) && i == 0)
+      /* Compare types for LHS.  */
+      if (i == 0)
        {
          if (!compatible_types_p (TREE_TYPE (arg1), TREE_TYPE (arg2)))
            return return_false_with_msg ("GIMPLE NOP LHS type mismatch");