From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Type: multipart/mixed; boundary="------------43170E0F5357CB52A84C838A" 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: , X-List-Received-Date: Mon, 16 Aug 2021 11:13:52 -0000 This is a multi-part message in MIME format. --------------43170E0F5357CB52A84C838A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I'm going to apply the following 3 tested patches. Martin --------------43170E0F5357CB52A84C838A Content-Type: text/x-patch; charset=UTF-8; name="0001-ipa-make-target_clone-default-decl-local-PR101726.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-ipa-make-target_clone-default-decl-local-PR101726.patch" >From 85b78f6c38bb357abb749fed81a1e7a589050461 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 12 Aug 2021 16:01:01 +0200 Subject: [PATCH 1/3] ipa: make target_clone default decl local [PR101726] PR ipa/101726 gcc/ChangeLog: * multiple_target.c (create_dispatcher_calls): Make default function local only if it is a definition. --- gcc/multiple_target.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/gcc/multiple_target.c b/gcc/multiple_target.c index e4192657cef..6c0565880c5 100644 --- a/gcc/multiple_target.c +++ b/gcc/multiple_target.c @@ -170,17 +170,20 @@ create_dispatcher_calls (struct cgraph_node *node) clone_function_name_numbered ( node->decl, "default")); - /* FIXME: copy of cgraph_node::make_local that should be cleaned up - in next stage1. */ - node->make_decl_local (); - node->set_section (NULL); - node->set_comdat_group (NULL); - node->externally_visible = false; - node->forced_by_abi = false; - node->set_section (NULL); - - DECL_ARTIFICIAL (node->decl) = 1; - node->force_output = true; + if (node->definition) + { + /* FIXME: copy of cgraph_node::make_local that should be cleaned up + in next stage1. */ + node->make_decl_local (); + node->set_section (NULL); + node->set_comdat_group (NULL); + node->externally_visible = false; + node->forced_by_abi = false; + node->set_section (NULL); + + DECL_ARTIFICIAL (node->decl) = 1; + node->force_output = true; + } } /* Return length of attribute names string, -- 2.32.0 --------------43170E0F5357CB52A84C838A Content-Type: text/x-patch; charset=UTF-8; name="0002-ipa-do-not-make-localaliases-for-target_clones-PR101.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-ipa-do-not-make-localaliases-for-target_clones-PR101.pa"; filename*1="tch" >From fbe246620e2fa5b5968718837ae4c12fdb85ba39 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 13 Aug 2021 11:10:56 +0200 Subject: [PATCH 2/3] ipa: do not make localaliases for target_clones [PR101261] PR ipa/101261 gcc/ChangeLog: * symtab.c (symtab_node::noninterposable_alias): Do not create local aliases for target_clone functions as the clonning pass rejects aliases. gcc/testsuite/ChangeLog: * gcc.target/i386/pr101261.c: New test. --- gcc/symtab.c | 2 ++ gcc/testsuite/gcc.target/i386/pr101261.c | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr101261.c diff --git a/gcc/symtab.c b/gcc/symtab.c index 2135b34ce27..5530a124a9d 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -1959,6 +1959,8 @@ symtab_node::noninterposable_alias (void) /* If aliases aren't supported by the assembler, fail. */ if (!TARGET_SUPPORTS_ALIASES) return NULL; + else if (lookup_attribute ("target_clones", DECL_ATTRIBUTES (node->decl))) + return NULL; /* Otherwise create a new one. */ new_decl = copy_node (node->decl); diff --git a/gcc/testsuite/gcc.target/i386/pr101261.c b/gcc/testsuite/gcc.target/i386/pr101261.c new file mode 100644 index 00000000000..d25d1a202c2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr101261.c @@ -0,0 +1,11 @@ +/* PR middle-end/101261 */ +/* { dg-do compile { target fpic } } */ +/* { dg-options "-fno-semantic-interposition -fPIC" } */ +/* { dg-require-ifunc "" } */ + +void +__attribute__((target_clones("default", "avx2"))) +dt_ioppr_transform_image_colorspace() +{ + dt_ioppr_transform_image_colorspace(); +} -- 2.32.0 --------------43170E0F5357CB52A84C838A Content-Type: text/x-patch; charset=UTF-8; name="0003-ipa-ICF-should-check-SSA_NAME_IS_DEFAULT_DEF.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0003-ipa-ICF-should-check-SSA_NAME_IS_DEFAULT_DEF.patch" >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 --------------43170E0F5357CB52A84C838A--