diff mbox

[Fortran] Print floating-point exception status after STOP/ERROR STOP

Message ID 51C6256E.1020708@net-b.de
State New
Headers show

Commit Message

Tobias Burnus June 22, 2013, 10:30 p.m. UTC
Eric Botcazou wrote:
>> My autoconf foo does not seem to be strong enough for libgfortran,
>> but I assume checking for both types and then using #ifdef HAVE_FP_EXCEPT_T
>> ...#elif HAVE_FP_EXCEPT...#endif ought to work?
> Yes, I think that we just need to patch the LIBGFOR_CHECK_FPSETMASK check in
> acinclude.m4 so as to also test the return type of the function.

Eric: I have a Solaris question. In acinclude.m4, one has:
#if HAVE_FLOATINGPOINT_H
# include <floatingpoint.h>
#endif /* HAVE_FLOATINGPOINT_H */
Should one also include that file?  Currently, only ieeefp.h is included 
via libgfortran.h.

Gerald and Eric: Would the following work for you? (Sorry, no 
config.h.in/configure patch; I haven't build in maintainer's mode, yet.)

--------------- Cut --------------------------
Tobias

Comments

Gerald Pfeifer June 23, 2013, 11:59 p.m. UTC | #1
On Sun, 23 Jun 2013, Tobias Burnus wrote:
> Gerald and Eric: Would the following work for you? (Sorry, no
> config.h.in/configure patch; I haven't build in maintainer's mode, yet.)

Yes, that looks like what I had in mind.  Thanks, Tobias!

Gerald
diff mbox

Patch

diff --git a/libgfortran/config/fpu-sysv.h b/libgfortran/config/fpu-sysv.h
index 1502b37..db95e9d 100644
--- a/libgfortran/config/fpu-sysv.h
+++ b/libgfortran/config/fpu-sysv.h
@@ -87,3 +87,9 @@  get_fpu_except_flags (void)
    int result;
+#if HAVE_FP_EXCEPT
    fp_except set_excepts;
+#elif HAVE_FP_EXCEPT_T
+  fp_except_t set_excepts;
+#else
+  choke me
+#endif

diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index ba14f1f..a2add6d 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -500,2 +500,3 @@  fi
  LIBGFOR_CHECK_FPSETMASK
+AC_CHECK_TYPES([fp_except fp_except_t], [], [], [[#include <ieeefp.h>]])
--------------- Cut --------------------------