From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 46478385B833 for ; Fri, 3 Apr 2020 07:04:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 46478385B833 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C8D76ABAD; Fri, 3 Apr 2020 07:04:14 +0000 (UTC) Subject: Re: [PATCH] ICF: compare type attributes for gimple_call_fntypes. To: Christophe Lyon Cc: gcc Patches References: From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <5eb56833-de67-6586-1103-03bb970adf71@suse.cz> Date: Fri, 3 Apr 2020 09:04:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-22.6 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 03 Apr 2020 07:04:17 -0000 On 4/2/20 7:17 PM, Christophe Lyon wrote: > On Thu, 2 Apr 2020 at 17:16, Martin Liška wrote: >> >> Hi. >> >> The patch compares type attributes for gimple_call_fntypes in IPA ICF. >> Note that we were unable to find a generic function attribute that >> can be used on a function type definition. >> >> For a one which is allowed assume_aligned(16) I get affects_type_identity == false >> which seems suspicious to me. >> >> Note that we currently use comp_type_attributes in ICF for both variable and >> function declarations. >> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >> >> Ready to be installed? >> Thanks, >> Martin >> > > Hi, > > Thanks for the quick patch! Hi. Good! > > I confirm it fixes the problem I noticed on arm with the cmse-15.c for > -O2 and -O3. > > However, the testcase still fails with -Os. I haven't looked at the > details, so it may be a different cause. I analyzed that slightly and there are still IPA ICF merged that happen (this time valid transformations): /home/marxin/Programming/gcc/gcc/testsuite/gcc.target/arm/cmse/cmse-15.c:14:5: optimized: Semantic equality hit:nonsecure0/4->nonsecure2/6 /home/marxin/Programming/gcc/gcc/testsuite/gcc.target/arm/cmse/cmse-15.c:14:5: optimized: Assembler symbol names:nonsecure0/4->nonsecure2/6 /home/marxin/Programming/gcc/gcc/testsuite/gcc.target/arm/cmse/cmse-15.c:33:5: optimized: Semantic equality hit:secure0/8->secure2/10 /home/marxin/Programming/gcc/gcc/testsuite/gcc.target/arm/cmse/cmse-15.c:33:5: optimized: Assembler symbol names:secure0/8->secure2/10 and with -Os nosecure2 -> mosecure0 call is not inlined bad again. That makes the scanning pattern to miss: -Os version: nonsecure2: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. b nonsecure0 -O2 version: nonsecure2: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 push {r4, lr} lsrs r0, r0, #1 lsls r0, r0, #1 mov r1, r0 mov r2, r0 mov r3, r0 bl __gnu_cmse_nonsecure_call Martin > > Thanks, > > Christophe > >> gcc/ChangeLog: >> >> 2020-04-02 Martin Liska >> >> PR ipa/94445 >> * ipa-icf-gimple.c (func_checker::compare_gimple_call): >> Compare type attributes for gimple_call_fntypes. >> --- >> gcc/ipa-icf-gimple.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >>