This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] Print floating-point exception status after STOP/ERROR STOP


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

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]