From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 8B222385842A; Fri, 28 Oct 2022 17:44:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B222385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666979042; bh=RA3P954ImGO2G/6hMg+EKH1KV8aoYvr0ssgRxMRUcew=; h=From:To:Subject:Date:From; b=pHXuhg0Ieeu3FwhZaV8+LyPBrVIkjHaLNkzdGm4HS4Sw5WmUPQbX+iYI9vSxRMLfA kIdWBDn+u8bQk7p5kttycm0RvulduZ0ELr+bDCPDTscWc1EYi1uE/cqh+MMjlrbPxR r9UK6P8P66laquTwiZdgMSwTyuEqA8n7L32+1/GI= 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: 848bfb238b6776677110c4b445d1d59695113333 X-Git-Newrev: 8c5bc925a54eb1e59fab634c7df03630527ca716 Message-Id: <20221028174402.8B222385842A@sourceware.org> Date: Fri, 28 Oct 2022 17:44:02 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8c5bc925a54eb1e59fab634c7df03630527ca716 commit 8c5bc925a54eb1e59fab634c7df03630527ca716 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 ();