public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/azanella/clang] math: Use -fexcess-precision=standard iff compiler supports it
Date: Wed,  7 Feb 2024 14:06:22 +0000 (GMT)	[thread overview]
Message-ID: <20240207140622.A74EC3858427@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b3f273490f35a5984dae212ad25f0d5d4884393

commit 2b3f273490f35a5984dae212ad25f0d5d4884393
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 17:22:41 2022 -0300

    math: Use -fexcess-precision=standard iff compiler supports it

Diff:
---
 configure                | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac             | 16 ++++++++++++++++
 math/Makefile            |  6 +++---
 support/Makefile         |  4 ++--
 sysdeps/x86/fpu/Makefile |  4 ++--
 5 files changed, 71 insertions(+), 7 deletions(-)

diff --git a/configure b/configure
index 742c5c7c14..b7c591dfaa 100755
--- a/configure
+++ b/configure
@@ -7123,6 +7123,54 @@ printf "%s\n" "$libc_cv_wno_ignored_attributes" >&6; }
 config_vars="$config_vars
 config-cflags-wno-ignored-attributes = $libc_cv_wno_ignored_attributes"
 
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wno-maybe-uninitialized" >&5
+printf %s "checking for -Wno-maybe-uninitialized... " >&6; }
+if test ${libc_cv_wno_maybe_uninitialized+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  		if { ac_try='${CC-cc} -Werror -Wno-maybe-uninitialized -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_wno_maybe_uninitialized=-Wno-maybe-uninitialized
+else $as_nop
+  libc_cv_wno_maybe_uninitialized=
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_wno_maybe_uninitialized" >&5
+printf "%s\n" "$libc_cv_wno_maybe_uninitialized" >&6; }
+config_vars="$config_vars
+config-cflags-wno-maybe-uninitialized = $libc_cv_wno_maybe_uninitialized"
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -fexcess-precision=standard" >&5
+printf %s "checking for -fexcess-precision=standard... " >&6; }
+if test ${libc_cv_fexcess_precision_standard+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  		if { ac_try='${CC-cc} -Werror -fexcess-precision=standard -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_fexcess_precision_standard=-fexcess-precision=standard
+else $as_nop
+  libc_cv_fexcess_precision_standard=
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_fexcess_precision_standard" >&5
+printf "%s\n" "$libc_cv_fexcess_precision_standard" >&6; }
+config_vars="$config_vars
+config-cflags-fexcess-precision-standard = $libc_cv_fexcess_precision_standard"
+
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether cc puts quotes around section names" >&5
 printf %s "checking whether cc puts quotes around section names... " >&6; }
 if test ${libc_cv_have_section_quotes+y}
diff --git a/configure.ac b/configure.ac
index c10e4bc306..591f7ee84d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1359,6 +1359,22 @@ rm -f conftest*])
 LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes],
 		[$libc_cv_wno_ignored_attributes])
 
+AC_CACHE_CHECK([for -Wno-maybe-uninitialized], libc_cv_wno_maybe_uninitialized, [dnl
+		LIBC_TRY_CC_OPTION([-Werror -Wno-maybe-uninitialized],
+				   [libc_cv_wno_maybe_uninitialized=-Wno-maybe-uninitialized],
+				   [libc_cv_wno_maybe_uninitialized=])
+])
+LIBC_CONFIG_VAR([config-cflags-wno-maybe-uninitialized],
+		[$libc_cv_wno_maybe_uninitialized])
+
+AC_CACHE_CHECK([for -fexcess-precision=standard], libc_cv_fexcess_precision_standard, [dnl
+		LIBC_TRY_CC_OPTION([-Werror -fexcess-precision=standard],
+				   [libc_cv_fexcess_precision_standard=-fexcess-precision=standard],
+				   [libc_cv_fexcess_precision_standard=])
+])
+LIBC_CONFIG_VAR([config-cflags-fexcess-precision-standard],
+		[$libc_cv_fexcess_precision_standard])
+
 AC_CACHE_CHECK(whether cc puts quotes around section names,
 	       libc_cv_have_section_quotes,
 	       [cat > conftest.c <<EOF
diff --git a/math/Makefile b/math/Makefile
index e405a70416..9f518dfe96 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -455,9 +455,9 @@ CFLAGS-test-math-iszero.cc += -std=gnu++11
 CFLAGS-test-math-issignaling.cc += -std=gnu++11
 CFLAGS-test-math-iscanonical.cc += -std=gnu++11
 
-CFLAGS-test-iszero-excess-precision.c += -fexcess-precision=standard
-CFLAGS-test-iseqsig-excess-precision.c += -fexcess-precision=standard
-CFLAGS-test-flt-eval-method.c += -fexcess-precision=standard
+CFLAGS-test-iszero-excess-precision.c += $(config-cflags-fexcess-precision-standard)
+CFLAGS-test-iseqsig-excess-precision.c += $(config-cflags-fexcess-precision-standard)
+CFLAGS-test-flt-eval-method.c += $(config-cflags-fexcess-precision-standard)
 
 CFLAGS-test-fe-snans-always-signal.c += $(config-cflags-signaling-nans)
 
diff --git a/support/Makefile b/support/Makefile
index 362a51f882..1e58711fa0 100644
--- a/support/Makefile
+++ b/support/Makefile
@@ -248,8 +248,8 @@ CFLAGS-.oS += -fexceptions -fasynchronous-unwind-tables
 # being within the observed range.  The code uses double internally
 # in support_timespec_check_in_range and for that computation we use
 # -fexcess-precision=standard.
-CFLAGS-timespec.c += -fexcess-precision=standard
-CFLAGS-timespec-time64.c += -fexcess-precision=standard
+CFLAGS-timespec.c += $(config-cflags-fexcess-precision-standard)
+CFLAGS-timespec-time64.c += $(config-cflags-fexcess-precision-standard)
 
 # Ensure that general support files use 64-bit time_t
 CFLAGS-delayed_exit.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64
diff --git a/sysdeps/x86/fpu/Makefile b/sysdeps/x86/fpu/Makefile
index 600e42c3db..68bd42cdd3 100644
--- a/sysdeps/x86/fpu/Makefile
+++ b/sysdeps/x86/fpu/Makefile
@@ -8,7 +8,7 @@ tests += test-fenv-sse test-fenv-clear-sse test-fenv-x87 test-fenv-sse-2 \
 CFLAGS-test-fenv-sse.c += -msse2 -mfpmath=sse
 CFLAGS-test-fenv-clear-sse.c += -msse2 -mfpmath=sse
 CFLAGS-test-fenv-sse-2.c += -msse2 -mfpmath=sse
-CFLAGS-test-flt-eval-method-387.c += -fexcess-precision=standard -mfpmath=387
-CFLAGS-test-flt-eval-method-sse.c += -fexcess-precision=standard -msse2 \
+CFLAGS-test-flt-eval-method-387.c += $(config-cflags-fexcess-precision-standard) -mfpmath=387
+CFLAGS-test-flt-eval-method-sse.c += $(config-cflags-fexcess-precision-standard) -msse2 \
 				     -mfpmath=sse
 endif

             reply	other threads:[~2024-02-07 14:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 14:06 Adhemerval Zanella [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:06 Adhemerval Zanella
2024-04-02 15:52 Adhemerval Zanella
2024-02-09 17:31 Adhemerval Zanella
2024-01-29 17:56 Adhemerval Zanella
2023-12-21 18:53 Adhemerval Zanella
2023-09-28 17:51 Adhemerval Zanella
2023-08-30 12:36 Adhemerval Zanella
2023-02-09 19:48 Adhemerval Zanella
2022-10-28 17:41 Adhemerval Zanella
2022-10-04 12:59 Adhemerval Zanella
2022-06-09 21:19 Adhemerval Zanella
2022-06-09 13:16 Adhemerval Zanella
2022-06-03 14:05 Adhemerval Zanella
2022-05-13 14:19 Adhemerval Zanella
2022-05-12 19:33 Adhemerval Zanella
2022-05-10 18:23 Adhemerval Zanella
2022-04-29 14:03 Adhemerval Zanella
2022-04-04 12:54 Adhemerval Zanella
2022-03-31 19:06 Adhemerval Zanella
2022-03-29 20:29 Adhemerval Zanella
2022-03-16 18:03 Adhemerval Zanella
2022-03-15 18:40 Adhemerval Zanella
2022-03-11 17:24 Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240207140622.A74EC3858427@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).