From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id A18E63857BBE; Fri, 28 Oct 2022 17:43:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A18E63857BBE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666978986; bh=vxqI9affoPfuAGOjGz/ZWfVMKLmwhPQlrmodQTxY6BY=; h=From:To:Subject:Date:From; b=T4nKnnITHEd2djbFOG6vfOXdEWT5uvwtGGGgur1ywJWwtYeTV1wzjVExTj2tGxbZl GEebS/MKQy5tgTUPBo6W6L7K8Bz9i8J5JFcc/TPe+iwuOQ3oHiM1jqn5RRVZR5cBai ja30n4huPy3dd2RwHfei+KY5uF4pq1L2bfS3vOX4= 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: 14501b237d364936f826e04bb089ff5880c40a53 X-Git-Newrev: 836d5e053849ce9566fedc1a9c3807db25fdd5e9 Message-Id: <20221028174306.A18E63857BBE@sourceware.org> Date: Fri, 28 Oct 2022 17:43:06 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=836d5e053849ce9566fedc1a9c3807db25fdd5e9 commit 836d5e053849ce9566fedc1a9c3807db25fdd5e9 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 03fceee905..4a02e5de12 100755 --- a/configure +++ b/configure @@ -6467,6 +6467,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 410ff604c2..a078b28914 100644 --- a/configure.ac +++ b/configure.ac @@ -1561,6 +1561,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