From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 8C2813834E65; Thu, 9 Jun 2022 13:18:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C2813834E65 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] Use -ffloat-store iff compiler supports it X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: dbba13221b1e367c7d7d79d7ee0f807d50cff5d5 X-Git-Newrev: f18148375b468d0f985faa0c0c2c1cb79e0a312e Message-Id: <20220609131817.8C2813834E65@sourceware.org> Date: Thu, 9 Jun 2022 13:18:17 +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 13:18:17 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f18148375b468d0f985faa0c0c2c1cb79e0a312e commit f18148375b468d0f985faa0c0c2c1cb79e0a312e Author: Adhemerval Zanella Date: Thu Mar 24 13:12:43 2022 -0300 Use -ffloat-store iff compiler supports it Diff: --- configure | 22 ++++++++++++++++++++++ configure.ac | 10 ++++++++++ math/Makefile | 4 ++-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure b/configure index ef97002749..5c528345dd 100755 --- a/configure +++ b/configure @@ -6513,6 +6513,28 @@ $as_echo "$libc_cv_cc_rounding_math" >&6; } config_vars="$config_vars config-cflags-frounding-math = $libc_cv_cc_rounding_math" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option that -ffloat-store" >&5 +$as_echo_n "checking for compiler option that -ffloat-store... " >&6; } +if ${libc_cv_cc_float_store+:} false; then : + $as_echo_n "(cached) " >&6 +else + if { ac_try='${CC-cc} -Werror -ffloat-store -xc /dev/null -S -o /dev/null' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + libc_cv_cc_float_store=-ffloat-store +else + libc_cv_cc_float_store= +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_float_store" >&5 +$as_echo "$libc_cv_cc_float_store" >&6; } +config_vars="$config_vars +config-cflags-float-store = $libc_cv_cc_float_store" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-tree-loop-distribute-patterns with \ __attribute__ ((__optimize__))" >&5 $as_echo_n "checking if $CC accepts -fno-tree-loop-distribute-patterns with \ diff --git a/configure.ac b/configure.ac index 7a8412f86b..b5e5a33c93 100644 --- a/configure.ac +++ b/configure.ac @@ -1544,6 +1544,16 @@ LIBC_TRY_CC_OPTION([-Werror -frounding-math], LIBC_CONFIG_VAR([config-cflags-frounding-math], [$libc_cv_cc_rounding_math]) +dnl Determine if compiler supports -ffloat-store +AC_CACHE_CHECK([for compiler option that -ffloat-store], + libc_cv_cc_float_store, [dnl +LIBC_TRY_CC_OPTION([-Werror -ffloat-store], + [libc_cv_cc_float_store=-ffloat-store], + [libc_cv_cc_float_store=]) +]) +LIBC_CONFIG_VAR([config-cflags-float-store], + [$libc_cv_cc_float_store]) + AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \ __attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl cat > conftest.c <3 million), so it may take a