From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id AA91A387158A for ; Wed, 14 Dec 2022 13:22:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA91A387158A Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 295F8280CCC; Wed, 14 Dec 2022 14:22:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1671024136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PIR1atA82w/fSlQT6c09oYYpvRhR4hF1/Vv+K7U2+M4=; b=cZ9d1mqFLySzFSZqWRvDL7ASVMhw4CNXjNuxEzUlh3r6Bc8aA/SQbPbtZVYxfvkCWaHueW G5zkMWgeJx6qbyQ2/Lh8YGxKZffWtZMZBmOzdcfE7L39UfRmkqYPxG1s3tU46jV62Gp9OP gNC3Ta/vO2WRRpKiTfYqfgRasFmN0ag= Date: Wed, 14 Dec 2022 14:22:16 +0100 From: Jan Hubicka To: "Kewen.Lin" Cc: GCC Patches , Richard Biener , Richard Sandiford , Segher Boessenkool , Peter Bergner Subject: Re: PING^1 [PATCH v2] predict: Adjust optimize_function_for_size_p [PR105818] Message-ID: References: <64451523-8036-6d9a-b990-e07746867efd@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64451523-8036-6d9a-b990-e07746867efd@linux.ibm.com> X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_SHORT,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: > > 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); > > +} 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. 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