From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 84D753858404; Fri, 9 Feb 2024 17:33:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84D753858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707500002; bh=f4VDxwPcrICE+Tp20RuMUVC9Hfb/mzrWFDr16oGo6o4=; h=From:To:Subject:Date:From; b=alRPcb66jNbSoqtgv+RqEWNCDJgawuxM/vbLgkTpc2exUUxc/vExoLRq46cZqSQPn K92eAfELgdvNE5WBTHKRm55qB+yjqNTou8b6kI9G6HrpeDB9/u11/cLGrndZevc6VN ygT0hpo5e/UN/Mw5JT8mOPX/PsO1rgXAek0wglco= 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: 8135781ced0959951eacde8d5ab184fafb46ca6a X-Git-Newrev: 787f2da8f82cc0b82a046ca7d2cecb82c9633e5f Message-Id: <20240209173322.84D753858404@sourceware.org> Date: Fri, 9 Feb 2024 17:33:22 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=787f2da8f82cc0b82a046ca7d2cecb82c9633e5f commit 787f2da8f82cc0b82a046ca7d2cecb82c9633e5f Author: Adhemerval Zanella Date: Thu Mar 24 13:12:43 2022 -0300 Use -ffloat-store iff compiler supports it Diff: --- configure | 24 ++++++++++++++++++++++++ configure.ac | 10 ++++++++++ math/Makefile | 4 ++-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 3256638e43..649270d302 100755 --- a/configure +++ b/configure @@ -7365,6 +7365,30 @@ printf "%s\n" "$libc_cv_cc_rounding_math" >&6; } config_vars="$config_vars config-cflags-frounding-math = $libc_cv_cc_rounding_math" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler option that -ffloat-store" >&5 +printf %s "checking for compiler option that -ffloat-store... " >&6; } +if test ${libc_cv_cc_float_store+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + libc_cv_cc_float_store=-ffloat-store +else $as_nop + libc_cv_cc_float_store= +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_float_store" >&5 +printf "%s\n" "$libc_cv_cc_float_store" >&6; } +config_vars="$config_vars +config-cflags-float-store = $libc_cv_cc_float_store" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-tree-loop-distribute-patterns with \ __attribute__ ((__optimize__))" >&5 printf %s "checking if $CC accepts -fno-tree-loop-distribute-patterns with \ diff --git a/configure.ac b/configure.ac index 704e4c259f..1f9d8b6e5e 100644 --- a/configure.ac +++ b/configure.ac @@ -1478,6 +1478,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