From patchwork Mon Aug 16 11:13:40 2021 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: 1517132 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=olORQDKd; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=bheWaKyw; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GpBPV22qVz9s5R for ; Mon, 16 Aug 2021 21:14:05 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2906F3851C23 for ; Mon, 16 Aug 2021 11:14:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id A76E7385F02E for ; Mon, 16 Aug 2021 11:13:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A76E7385F02E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 98F9621DF3 for ; Mon, 16 Aug 2021 11:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1629112420; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=i+62a1u4mCQZrXDjGDd0dX8msNz2AjV+tSKDirKQSy0=; b=olORQDKdQ+uJrM6EDeBc4ciOO6p2FwloNW9d/+ZOx8gB/NdlqypNXdsJ2EQDYzmjpzkLJB jeQYMFmNMnyJkGgrxoTlc0mRHNNx1aTPgBDVjBts91H0kVnprDG1+xXNNA1zRb5r6di+uy syl13EemzQtzCxWfiWU6RqpdE+o0DiM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1629112420; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=i+62a1u4mCQZrXDjGDd0dX8msNz2AjV+tSKDirKQSy0=; b=bheWaKyw+Tp7ir7gOe+vP5s3Or0xcnHLyYIuZMZMULZDbAa0+P57mYzQiI6zOUAS/9Vqj9 pjU1v68Cky3hPbAQ== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 89CB413301 for ; Mon, 16 Aug 2021 11:13:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id leD0H2RIGmECFgAAGKfGzw (envelope-from ) for ; Mon, 16 Aug 2021 11:13:40 +0000 To: GCC Patches From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: GCC 11 backports Message-ID: <9581571d-08e1-576b-d53a-90a0fd3ce516@suse.cz> Date: Mon, 16 Aug 2021 13:13:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" I'm going to apply the following 3 tested patches. Martin From 5b1bcb10b2cc6c93b06d22da0a044a6a6f362f0b Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 13 Aug 2021 12:35:47 +0200 Subject: [PATCH 3/3] ipa: ICF should check SSA_NAME_IS_DEFAULT_DEF PR ipa/100600 gcc/ChangeLog: * ipa-icf-gimple.c (func_checker::compare_ssa_name): Do not consider equal SSA_NAMEs when one is a param. gcc/testsuite/ChangeLog: * gcc.dg/ipa/pr100600.c: New test. --- gcc/ipa-icf-gimple.c | 3 +++ gcc/testsuite/gcc.dg/ipa/pr100600.c | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/ipa/pr100600.c diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index edf5f025627..cf0262621be 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -96,6 +96,9 @@ func_checker::compare_ssa_name (const_tree t1, const_tree t2) unsigned i1 = SSA_NAME_VERSION (t1); unsigned i2 = SSA_NAME_VERSION (t2); + if (SSA_NAME_IS_DEFAULT_DEF (t1) != SSA_NAME_IS_DEFAULT_DEF (t2)) + return false; + if (m_source_ssa_names[i1] == -1) m_source_ssa_names[i1] = i2; else if (m_source_ssa_names[i1] != (int) i2) diff --git a/gcc/testsuite/gcc.dg/ipa/pr100600.c b/gcc/testsuite/gcc.dg/ipa/pr100600.c new file mode 100644 index 00000000000..8a3d0e16e7e --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr100600.c @@ -0,0 +1,22 @@ +/* PR ipa/100600 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int a, b, c; +long d(long x, long e, long f, long g) { + long h, i; + for (; h < e; h++) { + i = f; + for (; i < g; i++) + c = b + a; + } + return h + i; +} + +long j(long x, long e, long y, long g) { + long h, i; + for (; h < e; h++) + for (; i < g; i++) + c = b + a; + return h + i; +} -- 2.32.0