From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53881 invoked by alias); 8 Oct 2018 10:14:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 53864 invoked by uid 89); 8 Oct 2018 10:14:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Oct 2018 10:14:09 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 08427ACAB; Mon, 8 Oct 2018 10:14:07 +0000 (UTC) Subject: Re: [PATCH] Redirect call within specific target attribute among MV clones (PR ipa/82625). To: "Richard Earnshaw (lists)" , Renlin Li , gcc-patches@gcc.gnu.org References: <70b0358c-5060-b5c0-9116-3b4e8e0b5146@suse.cz> <2a8a2cc1-1677-9d42-f2c9-973068b7eba2@foss.arm.com> <3e330d0a-e823-28c7-dcb7-d7121ece34f9@arm.com> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Mon, 08 Oct 2018 10:29:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <3e330d0a-e823-28c7-dcb7-d7121ece34f9@arm.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00405.txt.bz2 On 10/8/18 11:55 AM, Richard Earnshaw (lists) wrote: > On 08/10/18 10:47, Martin Li¨ka wrote: >> On 10/8/18 10:46 AM, Renlin Li wrote: >>> Hi Martin, >>> >>> pr82625.C failed on compiler builds which don't support "default" and "avx" target. >>> For example, arm/aarch64 native linux gcc compiler. >>> >>> >>> As I found in this gcc wiki: https://gcc.gnu.org/wiki/FunctionMultiVersioning >>> ''' >>> This support is available in GCC 4.8 and later. Support is only available in C++ for i386 targets. >>> ''' >>> >>> Should the test be guarded with a target selector or require function multi-versioning instead of ifunc? >> >> Hi. >> >> Sure, sorry for the breakage. I'm going to install following tested patch. >> >> Martin >> >>> >>> Regards, >>> Renlin >>> >>> >>> On 10/04/2018 02:56 PM, Martin Li¨ka wrote: >>>> Hi. >>>> >>>> When having a pair of target clones where foo calls bar, if the target >>>> attribute are equal we can redirect the call and not use ifunc dispatcher. >>>> >>>> Patch survives regression tests on x86_64-linux-gnu. >>>> Ready for trunk? >>>> >>>> Martin >>>> >>>> gcc/ChangeLog: >>>> >>>> 2018-10-04  Martin Liska  >>>> >>>>     PR ipa/82625 >>>>     * multiple_target.c (redirect_to_specific_clone): New function. >>>>     (ipa_target_clone): Use it. >>>>     * tree-inline.c: Fix comment. >>>> >>>> gcc/testsuite/ChangeLog: >>>> >>>> 2018-10-04  Martin Liska  >>>> >>>>     PR ipa/82625 >>>>     * g++.dg/ext/pr82625.C: New test. >>>> --- >>>>   gcc/multiple_target.c              | 51 ++++++++++++++++++++++++++++++ >>>>   gcc/testsuite/g++.dg/ext/pr82625.C | 36 +++++++++++++++++++++ >>>>   gcc/tree-inline.c                  |  2 +- >>>>   3 files changed, 88 insertions(+), 1 deletion(-) >>>>   create mode 100644 gcc/testsuite/g++.dg/ext/pr82625.C >>>> >>>> >> >> >> 0001-Limit-a-MV-test-just-for-x86-target.patch >> >> >> From e3053abe58eba832262db0af77980012010a642c Mon Sep 17 00:00:00 2001 >> From: marxin >> Date: Mon, 8 Oct 2018 11:07:29 +0200 >> Subject: [PATCH] Limit a MV test just for x86 target. >> >> gcc/testsuite/ChangeLog: >> >> 2018-10-08 Martin Liska >> >> * g++.dg/ext/pr82625.C: Add dg-compile filter. >> --- >> gcc/testsuite/g++.dg/ext/pr82625.C | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/gcc/testsuite/g++.dg/ext/pr82625.C b/gcc/testsuite/g++.dg/ext/pr82625.C >> index 47bd2df1104..59b174f8c51 100644 >> --- a/gcc/testsuite/g++.dg/ext/pr82625.C >> +++ b/gcc/testsuite/g++.dg/ext/pr82625.C >> @@ -1,6 +1,7 @@ >> /* { dg-do compile } */ >> /* { dg-require-ifunc "" } */ >> /* { dg-options "-O2 -fdump-tree-optimized" } */ >> +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ >> >> __attribute__ ((target ("default"))) >> static unsigned foo(const char *buf, unsigned size) { >> > > Which begs the question why is this not put under g++.target? > > R. > Agree, apparently we have quite some tests that should be moved: gcc/testsuite/g++.dg/ext/pr57362.C:/* { dg-require-ifunc "" } */ gcc/testsuite/g++.dg/ext/pr57548.C:/* { dg-require-ifunc "" } */ gcc/testsuite/g++.dg/ext/pr82625.C:/* { dg-require-ifunc "" } */ gcc/testsuite/g++.dg/ext/pr85329-2.C:/* { dg-require-ifunc "" } */ gcc/testsuite/g++.dg/ext/pr85329.C:/* { dg-require-ifunc "" } */ ... gcc/testsuite/g++.dg/ext/mv*.C I'll prepare patch for it. Martin