From patchwork Mon Feb 17 15:21:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1239327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-519657-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=iRXR7M6T; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Lnkx3rHLz9sPk for ; Tue, 18 Feb 2020 02:21:28 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=WorXAjtze0IkmJNpJ5z/Xk/In++Xx4rmW5/tUozO9TOX09ezwPmB7 n6LnPM8HXv32bSMnpzud0JiSVk1cMM0cIvgXDof01HSO/2QPZnJX0M4mfcd7yoVF 4TkqeAjtpqF+iGvSIrLDzINroPr9ChQmA5/8zsLOPLnj6pYh5hpBsc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; s= default; bh=Voi6uC6r8lnFihRSX9jt1RGSaFE=; b=iRXR7M6TeUpFM5epXnM/ 6zOHsaWGPsNJCI5GGp1MqzUQAYF1c05PKy8EuyHvMGh7jpUJS6GGWjZecWKx7r5l NxFgc0SjVCx/aAriZHzfPWL1C5DKQ04hkwMSIxKnLSlaj/0V1wgfBqqHKGNIi5U0 RZ/hzPvdtzeLCLDRMavrAGA= Received: (qmail 84823 invoked by alias); 17 Feb 2020 15:21:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 84814 invoked by uid 89); 17 Feb 2020 15:21:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Feb 2020 15:21:20 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 86B09B321 for ; Mon, 17 Feb 2020 15:21:18 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Compare more sensitive FIX_TRUNC_EXPR in IPA ICF. To: gcc-patches@gcc.gnu.org Message-ID: <3cbfc86f-d274-8edd-573c-b501a163de8c@suse.cz> Date: Mon, 17 Feb 2020 16:21:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi. The patch is extension of 446096148ca9775cb56f9ee924fa283babcd0b76 commit where we need to handle FIX_TRUNC_EXPR in compare_gimple_assign. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: 2020-02-17 Martin Liska PR ipa/92518 * ipa-icf-gimple.c (func_checker::compare_gimple_assign): Consider also FIX_TRUNC_EXPR. --- gcc/ipa-icf-gimple.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index fa71a028c66..4a4f06b79b4 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -621,7 +621,9 @@ func_checker::compare_gimple_assign (gimple *s1, gimple *s2) arg2 = gimple_op (s2, i); /* LHS types of NOP_EXPR must be compatible. */ - if (CONVERT_EXPR_CODE_P (code1) && i == 0) + if ((CONVERT_EXPR_CODE_P (code1) + || code1 == FIX_TRUNC_EXPR) + && i == 0) { if (!compatible_types_p (TREE_TYPE (arg1), TREE_TYPE (arg2))) return return_false_with_msg ("GIMPLE NOP LHS type mismatch");