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]

[patch libgfortran RFC] A tiny configury patch for SH


Hi,

Alpha and SH requires -mieee option for NaN/Inf.  I've missed
that several libgfortran files use NaN/Inf via __builtin_nan and
__builtin_inf.
Alpha adds -mieee to CFLAGS_FOR_TARGET with the top level
configury files to enable -mieee for all target library, but
the comment for them in the top level configure.ac says that
it should probably be set individually by each library.
The attached tiny patch is to incorporate the latter for SH.
It's tested with bootstrap and the top level "make -k check"
on i686-pc-linux-gnu with no new failures.

Regards,
	kaz
--
2009-07-30  Kaz Kojima  <kkojima@gcc.gnu.org>

	* configure.host: Define ieee_flags and set it to -mieee for sh.
	* configure.ac: Set IEEE_FLAGS with ieee_flags.
	* Makefile.am: Add IEEE_FLAGS to AM_CFLAGS.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

diff -uprN ORIG/trunk/libgfortran/Makefile.am trunk/libgfortran/Makefile.am
--- ORIG/trunk/libgfortran/Makefile.am	2009-07-20 14:22:58.000000000 +0900
+++ trunk/libgfortran/Makefile.am	2009-07-28 09:57:56.000000000 +0900
@@ -37,6 +37,10 @@ AM_CFLAGS += -fcx-fortran-rules
 SECTION_FLAGS = @SECTION_FLAGS@
 AM_CFLAGS += $(SECTION_FLAGS)
 
+# Some targets require additional compiler options for IEEE compatibility.
+IEEE_FLAGS = @IEEE_FLAGS@
+AM_CFLAGS += $(IEEE_FLAGS)
+
 gfor_io_src= \
 io/close.c \
 io/file_pos.c \
diff -uprN ORIG/trunk/libgfortran/configure.ac trunk/libgfortran/configure.ac
--- ORIG/trunk/libgfortran/configure.ac	2009-05-30 18:35:45.000000000 +0900
+++ trunk/libgfortran/configure.ac	2009-07-28 10:11:35.000000000 +0900
@@ -448,6 +448,10 @@ AC_MSG_NOTICE([FPU dependent file will b
 FPU_HOST_HEADER=config/${fpu_host}.h
 AC_SUBST(FPU_HOST_HEADER)
 
+# Some targets require additional compiler options for IEEE compatibility.
+IEEE_FLAGS="${ieee_flags}"
+AC_SUBST(IEEE_FLAGS)
+
 # Check out attribute support.
 LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY
 LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT
diff -uprN ORIG/trunk/libgfortran/configure.host trunk/libgfortran/configure.host
--- ORIG/trunk/libgfortran/configure.host	2005-10-29 06:53:00.000000000 +0900
+++ trunk/libgfortran/configure.host	2009-07-28 09:58:19.000000000 +0900
@@ -38,3 +38,10 @@ fi
 if test "x${have_fp_enable}" = "xyes" && test "x${have_fp_trap}" = "xyes"; then
   fpu_host='fpu-aix'
 fi
+
+# Some targets require additional compiler options for NaN/Inf.
+ieee_flags=
+case "${host_cpu}" in
+  sh*)
+    ieee_flags="-mieee" ;;
+esac


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