From 08afe87b7976e93197a66e01f93191ead496ad42 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 18 Feb 2020 15:07:06 +0100 Subject: [PATCH] Always compare types of LHS for gimple_assign in ICF. PR ipa/92518 * ipa-icf-gimple.c (func_checker::compare_gimple_assign): Always compare LHS of gimple_assign. --- gcc/ChangeLog | 6 ++++++ gcc/ipa-icf-gimple.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b4b49424eae..c107f19a0f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2020-02-18 Martin Liska + + PR ipa/92518 + * ipa-icf-gimple.c (func_checker::compare_gimple_assign): + Always compare LHS of gimple_assign. + 2020-02-18 Martin Liska PR ipa/93583 diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index fa71a028c66..3e5b2d4bd6d 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -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"); -- 2.30.2