From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 70C0238582BC; Wed, 7 Feb 2024 14:09:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70C0238582BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707314978; bh=aQTWK4cCzNLKA6WdX/6FAiSbiWb1aOF5NvRqQEh+pr8=; h=From:To:Subject:Date:From; b=TzH/p1NhFX2kgPeDRbElR4aGVmv9c+z2pIHTUi31YdGaOU3uVVPlbUvRG8Ky+s5Dk JJ8fsJDx1o16X9N14JhomTXHmcJmHG8aezf+uGDQbv+oF6yBot13Mj1SdI3llFpg9o DHaDbq3Ah1UyYgi5ZNUh8IIdBC5HKEEmzXX52yX8= 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: 284b759477fe408a8b0a8cb57b6b6b2597efcceb X-Git-Newrev: 97154629280c0346421e81e15a8af18ac34e4a4d Message-Id: <20240207140938.70C0238582BC@sourceware.org> Date: Wed, 7 Feb 2024 14:09:38 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=97154629280c0346421e81e15a8af18ac34e4a4d commit 97154629280c0346421e81e15a8af18ac34e4a4d 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 3b283f49a6..1ac3c2e751 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 ();