From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 37E783858C39; Tue, 4 Oct 2022 13:01:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37E783858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664888508; bh=gg0TPxCRmh4aplqJXZQ1H8Drmlv25by+eoy0o/PATwI=; h=From:To:Subject:Date:From; b=LYp1QyDYxmU1cngYDriqcPUQnnvKZxu3BXjolTGFBIUsPYFwEK/SvDuUYhD8RS9vD Adn4wSQUxRFjHD5xwGydSYSqi3Wvc9qxB3+Mc7Yb4Pb/PgF/+ZmIBRFQsPioAImhJ/ J0wLfpx9JDj0NR7QnPEX7HNkJ4ighvv41mxv4l8E= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] stdio: Disable attribute (optimize) if compiler does not support it X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 466b53dc0e683bdc3216c3f4520ad459f0175f4f X-Git-Newrev: 5e8b8f00c39e60ea1a2f123aca30b3010d59446e Message-Id: <20221004130148.37E783858C39@sourceware.org> Date: Tue, 4 Oct 2022 13:01:48 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5e8b8f00c39e60ea1a2f123aca30b3010d59446e commit 5e8b8f00c39e60ea1a2f123aca30b3010d59446e Author: Adhemerval Zanella Date: Thu Mar 24 15:54:10 2022 -0300 stdio: Disable attribute (optimize) if compiler does not support it Diff: --- stdio-common/tst-printf-bz18872.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stdio-common/tst-printf-bz18872.sh b/stdio-common/tst-printf-bz18872.sh index 8cf3dc6738..37e4d7b632 100644 --- a/stdio-common/tst-printf-bz18872.sh +++ b/stdio-common/tst-printf-bz18872.sh @@ -31,7 +31,13 @@ cat <<'EOF' Compile do_test without optimization: GCC 4.9/5.0/6.0 takes a long time to build this source. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67396 */ -__attribute__ ((optimize ("-O0"))) +#if __GNUC_PREREQ (4, 4) || __glibc_has_attribute (__optimize__) +# define attribute_optimize(level) __attribute__ ((optimize (level))) +#else +# define attribute_optimize(level) +#endif + +attribute_optimize ("-O0") int do_test (void) { mtrace ();