From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 26EFA384BC2B; Thu, 9 Jun 2022 21:22:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26EFA384BC2B 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: 5bee2ff5f8d1fb8d666b5bdfd8cfcbe26333696a X-Git-Newrev: a9ae131d1a39f3beaa677472f01e168f55249844 Message-Id: <20220609212234.26EFA384BC2B@sourceware.org> Date: Thu, 9 Jun 2022 21:22:34 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2022 21:22:34 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a9ae131d1a39f3beaa677472f01e168f55249844 commit a9ae131d1a39f3beaa677472f01e168f55249844 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 ();