From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 270F23858292; Thu, 21 Dec 2023 18:56:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 270F23858292 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1703184983; bh=GuPBNPhMxwK/ebfuJs5dDlhMvoccCvsXNVD+FKCJgUw=; h=From:To:Subject:Date:From; b=SZ8dNuXg7X04Et9+x/awDIrg3FdWh23F1xZ6FNv2LsYuA540fg/0UvLYT+KeksXj8 1TWg23s7j41M1df55+2gjSFxU35FA1Ro4jkIKiJ7oABlXW14JkeGnlgiwsbXseqpdf ce7Q7jwPt9tjCZhbtXEVNMZ+0W4UE+lor6rpEitQ= 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: 0c83d94c5181cae54175543baee3401cb355fe06 X-Git-Newrev: 5fd7e89b4eb2f9fb96e6d2b38b01d4bf4a3a0573 Message-Id: <20231221185623.270F23858292@sourceware.org> Date: Thu, 21 Dec 2023 18:56:23 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5fd7e89b4eb2f9fb96e6d2b38b01d4bf4a3a0573 commit 5fd7e89b4eb2f9fb96e6d2b38b01d4bf4a3a0573 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 db6ced5e2f..b8f16c052d 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 ();