From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 4E62A3883F07 for ; Wed, 14 Dec 2022 13:55:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4E62A3883F07 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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 2AB80223E1; Wed, 14 Dec 2022 13:55:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1671026108; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HROoV93hcKnUz9TgBkMJXJxoU6JHtElgd9Zj4hpP0qU=; b=wsR14HrYlGx9a5DoqW8gCUN6F9IuIxp40SGgFpqMmUXTgGPw+YsctIGPaOf8PP9RZSBGg5 xH9CcRmU/M166JGzxFuLlHVE/0M2P3pZHKYfLppQ4GXLB8TLrdkAMXQESimD4QumsFBf74 xcJjcdtVK5G4fvDia4SjRc0kJGKjvPY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1671026108; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HROoV93hcKnUz9TgBkMJXJxoU6JHtElgd9Zj4hpP0qU=; b=MTdFmNZeTRPQ2lTH4IyXc1v0Sg6jUfI40udD25fXvPWgV/cVjEWQg2Rq6QJ8x1w8WIOMbk 3dwlWniKxoqnenBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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 imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 03FD4138F6; Wed, 14 Dec 2022 13:55:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id I1wRO7vVmWMFFQAAMHmgww (envelope-from ); Wed, 14 Dec 2022 13:55:07 +0000 Message-ID: <4353f6f5-812c-2d09-7bef-2b763159df7b@suse.cz> Date: Wed, 14 Dec 2022 14:55:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: PING^1 [PATCH v2] predict: Adjust optimize_function_for_size_p [PR105818] Content-Language: en-US To: Jan Hubicka , "Kewen.Lin" Cc: GCC Patches , Richard Biener , Richard Sandiford , Segher Boessenkool , Peter Bergner References: <64451523-8036-6d9a-b990-e07746867efd@linux.ibm.com> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,SPF_HELO_NONE,SPF_SOFTFAIL,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12/14/22 14:22, Jan Hubicka via Gcc-patches wrote: >>> PR middle-end/105818 >>> >>> gcc/ChangeLog: >>> >>> * predict.cc (optimize_function_for_size_p): Further check >>> optimize_size of fun->decl when it is valid but no cgraph node. >>> >>> gcc/testsuite/ChangeLog: >>> >>> * gcc.target/powerpc/pr105818.c: New test. >>> * gcc.dg/guality/pr54693-2.c: Adjust for aarch64. >>> diff --git a/gcc/testsuite/gcc.target/powerpc/pr105818.c b/gcc/testsuite/gcc.target/powerpc/pr105818.c >>> new file mode 100644 >>> index 00000000000..679647e189d >>> --- /dev/null >>> +++ b/gcc/testsuite/gcc.target/powerpc/pr105818.c >>> @@ -0,0 +1,11 @@ >>> +/* { dg-options "-Os -fno-tree-vectorize" } */ >>> + >>> +/* Verify there is no ICE. */ >>> + >>> +#pragma GCC optimize "-fno-tree-vectorize" >>> + >>> +void >>> +foo (void) >>> +{ >>> + void bar (void); >>> +} Hi. Next time, please CC me if you cite me. > So the testcase starts with optimize_size set but then it switches to > optimize_size==0 due to the GCC optimize pragma. I think this is > behaviour Martin wants to change, so perhaps the testcase should be > written with explicit -O2. No, the pragma does not modify optimize_size as "optimize" attribute behaves as documented: ``` ... The optimize attribute arguments of a function behave behave as if appended to the command-line. ``` Martin > > I also wonder what happen when you add the attribute later? > /* { dg-options "-Os -fno-tree-vectorize" } */ > > /* Verify there is no ICE. */ > > #pragma GCC optimize "-fno-tree-vectorize" > > void > foo (void) > { > void bar (void); > } > > __attribute__ ((optimize("-fno-tree-vectorize"))) void foo (void); > > I think we should generally avoid doing decisions about size/speed > optimizations so early since the setting may change due to attribtes or > profile feedback... > > Honza