unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu
@ 2018-07-07 18:26 Ulrich Mueller
  2018-07-07 21:27 ` Paul Eggert
  0 siblings, 1 reply; 9+ messages in thread
From: Ulrich Mueller @ 2018-07-07 18:26 UTC (permalink / raw)
  To: 32086; +Cc: Tobias Klausmann

Another regression on alpha-unknown-linux-gnu, byte-compilation of the
following four lisp files fails with floating point exceptions:

make[2]: Entering directory '/space/homedirs/ulm/emacs/lisp'
EMACSLOADPATH= '../src/emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  -f batch-byte-compile calculator.el
EMACSLOADPATH= '../src/emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  -f batch-byte-compile calc/calc-math.el
EMACSLOADPATH= '../src/emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  -f batch-byte-compile nxml/rng-xsd.el
EMACSLOADPATH= '../src/emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  -f batch-byte-compile org/org-table.el
make[2]: *** [Makefile:297: calc/calc-math.elc] Floating point exception
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:297: nxml/rng-xsd.elc] Floating point exception
make[2]: *** [Makefile:297: calculator.elc] Floating point exception
make[2]: *** [Makefile:297: org/org-table.elc] Floating point exception
make[2]: Leaving directory '/space/homedirs/ulm/emacs/lisp'
make[1]: *** [Makefile:320: compile-main] Error 2
make[1]: Leaving directory '/space/homedirs/ulm/emacs/lisp'
make: *** [Makefile:405: lisp] Error 2

The exceptions are triggered in functions string_to_number in lread.c
and float_to_string in print.c when values of infinity or NaN are
being passed.

The same lisp files (from the emacs-26 branch) can be compiled with
Emacs 25.3, though.

(On first glance, it doesn't look like the code in lread.c and print.c
has changed, so the problem must be somewhere else. Signal handling?)


In GNU Emacs 26.1.50 (build 1, alpha-unknown-linux-gnu)
 of 2018-07-07 built on monolith
Repository revision: b73cde5e2815c531df7f5fd13e214a7d92f78239

Configured using:
 'configure --prefix=/usr --build=alpha-unknown-linux-gnu
 --host=alpha-unknown-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --disable-silent-rules
 --docdir=/usr/share/doc/emacs-26.1
 --htmldir=/usr/share/doc/emacs-26.1/html --libdir=/usr/lib
 --program-suffix=-emacs-26 --infodir=/usr/share/info/emacs-26
 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --enable-acl --without-dbus
 --without-modules --without-gameuser --without-gpm --without-kerberos
 --without-kerberos5 --without-lcms2 --without-xml2 --without-mailutils
 --without-selinux --with-gnutls --without-libsystemd --with-threads
 --without-wide-int --with-zlib --with-sound=no --without-x
 --without-ns'

Configured features:
NOTIFY ACL GNUTLS ZLIB THREADS





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu
  2018-07-07 18:26 bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu Ulrich Mueller
@ 2018-07-07 21:27 ` Paul Eggert
  2018-07-07 22:47   ` Ulrich Mueller
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Eggert @ 2018-07-07 21:27 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: 32086

[-- Attachment #1: Type: text/plain, Size: 141 bytes --]

Thanks for reporting the bug. Please try the attached patch, which I'd like to 
install into the emacs-26 branch if it fixes your problem.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-floating-point-exceptions-on-Alpha-Bug-32086.patch --]
[-- Type: text/x-patch; name="0001-Fix-floating-point-exceptions-on-Alpha-Bug-32086.patch", Size: 7390 bytes --]

From 960603eb5677265575b786671719d5746164e18c Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 7 Jul 2018 14:24:46 -0700
Subject: [PATCH] Fix floating point exceptions on Alpha (Bug#32086)

* admin/merge-gnulib (GNULIB_MODULES): Add fpieee.
* m4/fpieee.m4: New file, copied from Gnulib.
* m4/gnulib-comp.m4: Regenerate.
---
 admin/merge-gnulib |  2 +-
 lib/gnulib.mk.in   |  2 +-
 m4/fpieee.m4       | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 m4/gnulib-comp.m4  |  3 +++
 4 files changed, 59 insertions(+), 2 deletions(-)
 create mode 100644 m4/fpieee.m4

diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index 42edfbb..b23adc2 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -33,7 +33,7 @@ GNULIB_MODULES=
   d-type diffseq dtoastr dtotimespec dup2
   environ execinfo explicit_bzero faccessat
   fcntl fcntl-h fdatasync fdopendir
-  filemode filevercmp flexmember fstatat fsync
+  filemode filevercmp flexmember fpieee fstatat fsync
   getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog
   ignore-value intprops largefile lstat
   manywarnings memrchr minmax mkostemp mktime nstrftime
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 71c01e3..e69ae45 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stat --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=tzset --avoid=unsetenv --avoid=utime --avoid=utime-h --gnu-make --makefile-name=gnulib.mk.in --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-leading-zeros count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 d-type diffseq dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp flexmember fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr minmax mkostemp mktime nstrftime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strtoimax symlink sys_stat sys_time tempname time time_r time_rz timegm timer-time timespec-add timespec-sub unlocked-io update-copyright utimens vla warnings
+# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stat --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=tzset --avoid=unsetenv --avoid=utime --avoid=utime-h --gnu-make --makefile-name=gnulib.mk.in --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-leading-zeros count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 d-type diffseq dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp flexmember fpieee fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr minmax mkostemp mktime nstrftime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strtoimax symlink sys_stat sys_time tempname time time_r time_rz timegm timer-time timespec-add timespec-sub unlocked-io update-copyright utimens vla warnings
 
 
 MOSTLYCLEANFILES += core *.stackdump
diff --git a/m4/fpieee.m4 b/m4/fpieee.m4
new file mode 100644
index 0000000..b58840f
--- /dev/null
+++ b/m4/fpieee.m4
@@ -0,0 +1,54 @@
+# fpieee.m4 serial 2  -*- coding: utf-8 -*-
+dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl IEEE 754 standardized three items:
+dnl - The formats of single-float and double-float - nowadays commonly
+dnl   available as 'float' and 'double' in C and C++.
+dnl   No autoconf test needed.
+dnl - The overflow and division by zero behaviour: The result are values
+dnl   '±Inf' and 'NaN', rather than exceptions as it was before.
+dnl   This file provides an autoconf macro for ensuring this behaviour of
+dnl   floating-point operations.
+dnl - A set of conditions (overflow, underflow, inexact, etc.) which can
+dnl   be configured to trigger an exception.
+dnl   This cannot be done in a portable way: it depends on the compiler,
+dnl   libc, kernel, and CPU.  No autoconf macro is provided for this.
+
+dnl Ensure non-trapping behaviour of floating-point overflow and
+dnl floating-point division by zero.
+dnl (For integer overflow, see gcc's -ftrapv option; for integer division by
+dnl zero, see the autoconf macro in intdiv0.m4.)
+
+AC_DEFUN([gl_FP_IEEE],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  # IEEE behaviour is the default on all CPUs except Alpha and SH
+  # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
+  # and the GCC 4.1.2 manual).
+  case "$host_cpu" in
+    alpha*)
+      # On Alpha systems, a compiler option provides the behaviour.
+      # See the ieee(3) manual page, also available at
+      # <https://backdrift.org/man/tru64/man3/ieee.3.html>
+      if test -n "$GCC"; then
+        # GCC has the option -mieee.
+        # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
+        CPPFLAGS="$CPPFLAGS -mieee"
+      else
+        # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
+        # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
+        CPPFLAGS="$CPPFLAGS -ieee"
+      fi
+      ;;
+    sh*)
+      if test -n "$GCC"; then
+        # GCC has the option -mieee.
+        CPPFLAGS="$CPPFLAGS -mieee"
+      fi
+      ;;
+  esac
+])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 167356f..e30ff1f 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -86,6 +86,8 @@ AC_DEFUN
   # Code from module filevercmp:
   # Code from module flexmember:
   # Code from module fpending:
+  # Code from module fpieee:
+  AC_REQUIRE([gl_FP_IEEE])
   # Code from module fstatat:
   # Code from module fsync:
   # Code from module getdtablesize:
@@ -994,6 +996,7 @@ AC_DEFUN
   m4/filemode.m4
   m4/flexmember.m4
   m4/fpending.m4
+  m4/fpieee.m4
   m4/fstatat.m4
   m4/fsync.m4
   m4/getdtablesize.m4
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu
  2018-07-07 21:27 ` Paul Eggert
@ 2018-07-07 22:47   ` Ulrich Mueller
  2018-07-08 16:27     ` Paul Eggert
  0 siblings, 1 reply; 9+ messages in thread
From: Ulrich Mueller @ 2018-07-07 22:47 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 32086

>>>>> On Sat, 7 Jul 2018, Paul Eggert wrote:

> Thanks for reporting the bug. Please try the attached patch, which
> I'd like to install into the emacs-26 branch if it fixes your
> problem.

This fixes it. Thanks again.

(And please ignore my earlier remark that the lisp files in question
can be byte-compiled with Emacs 25.3. It turns out that the Emacs I
used for testing had been built with -mieee in CFLAGS.)





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu
  2018-07-07 22:47   ` Ulrich Mueller
@ 2018-07-08 16:27     ` Paul Eggert
  2018-07-08 16:51       ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Eggert @ 2018-07-08 16:27 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: 32086-done

Ulrich Mueller wrote:
> This fixes it. Thanks again.
> 
> (And please ignore my earlier remark that the lisp files in question
> can be byte-compiled with Emacs 25.3. It turns out that the Emacs I
> used for testing had been built with -mieee in CFLAGS.)

Thanks for checking. Since this is not a regression in Emacs 26, I installed the 
patch into the Emacs master branch, and am marking the bug as done.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu
  2018-07-08 16:27     ` Paul Eggert
@ 2018-07-08 16:51       ` Eli Zaretskii
  2018-07-08 17:11         ` Paul Eggert
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2018-07-08 16:51 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 32086, ulm

> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sun, 8 Jul 2018 09:27:17 -0700
> Cc: 32086-done@debbugs.gnu.org
> 
> Ulrich Mueller wrote:
> > This fixes it. Thanks again.
> > 
> > (And please ignore my earlier remark that the lisp files in question
> > can be byte-compiled with Emacs 25.3. It turns out that the Emacs I
> > used for testing had been built with -mieee in CFLAGS.)
> 
> Thanks for checking. Since this is not a regression in Emacs 26, I installed the 
> patch into the Emacs master branch, and am marking the bug as done.

Thanks.  But doesn't this mean Emacs 26 will not build on that
platform?  Maybe we should backport your change to emacs-26 after all.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu
  2018-07-08 16:51       ` Eli Zaretskii
@ 2018-07-08 17:11         ` Paul Eggert
  2018-07-08 17:38           ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Eggert @ 2018-07-08 17:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 32086, ulm

Eli Zaretskii wrote:
> But doesn't this mean Emacs 26 will not build on that
> platform?  Maybe we should backport your change to emacs-26 after all.

That'd be fine with me, and if you prefer that I'll backport the change. Emacs 
26 does not build properly on that platform unless the builder uses something 
like "./configure CFLAGS=-mieee" when building Emacs.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu
  2018-07-08 17:11         ` Paul Eggert
@ 2018-07-08 17:38           ` Eli Zaretskii
  2018-07-08 18:42             ` Paul Eggert
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2018-07-08 17:38 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 32086, ulm

> Cc: 32086@debbugs.gnu.org, ulm@gentoo.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sun, 8 Jul 2018 10:11:32 -0700
> 
> Eli Zaretskii wrote:
> > But doesn't this mean Emacs 26 will not build on that
> > platform?  Maybe we should backport your change to emacs-26 after all.
> 
> That'd be fine with me, and if you prefer that I'll backport the change. Emacs 
> 26 does not build properly on that platform unless the builder uses something 
> like "./configure CFLAGS=-mieee" when building Emacs.

Unless it's an obscure platform, I think we'd better support it.
Emacs 27 won't be out for a year at least, probably longer, and that's
too long for a platform we want to support, I think.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu
  2018-07-08 17:38           ` Eli Zaretskii
@ 2018-07-08 18:42             ` Paul Eggert
  2018-07-08 18:53               ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Eggert @ 2018-07-08 18:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 32086, ulm

Eli Zaretskii wrote:
> Unless it's an obscure platform, I think we'd better support it.

OK, I backported it to emacs-26.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu
  2018-07-08 18:42             ` Paul Eggert
@ 2018-07-08 18:53               ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2018-07-08 18:53 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 32086, ulm

> Cc: 32086@debbugs.gnu.org, ulm@gentoo.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sun, 8 Jul 2018 11:42:09 -0700
> 
> Eli Zaretskii wrote:
> > Unless it's an obscure platform, I think we'd better support it.
> 
> OK, I backported it to emacs-26.

Thanks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-07-08 18:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-07 18:26 bug#32086: 26.1.50; Floating point exceptions during byte-compilation on alpha-unknown-linux-gnu Ulrich Mueller
2018-07-07 21:27 ` Paul Eggert
2018-07-07 22:47   ` Ulrich Mueller
2018-07-08 16:27     ` Paul Eggert
2018-07-08 16:51       ` Eli Zaretskii
2018-07-08 17:11         ` Paul Eggert
2018-07-08 17:38           ` Eli Zaretskii
2018-07-08 18:42             ` Paul Eggert
2018-07-08 18:53               ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).