diff: add -fno-gcse -fno-function-cse to CFLAGS_FOR_GOTOS

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Dec 17 03:53:14 AEDT 1998


Estimated hours taken: 2

configure.in:
	Add `-fno-gcse -fno-function-cse' to the default CFLAGS_FOR_GOTOS,
	since that seems to be needed on all architectures, not just sparcs.

Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.142
diff -u -r1.142 configure.in
--- configure.in	1998/11/11 07:07:28	1.142
+++ configure.in	1998/12/16 16:45:54
@@ -1148,10 +1148,19 @@
 AC_SUBST(IO_HAVE_TEMPNAM)
 #-----------------------------------------------------------------------------#
 #
+# On sparc, x86, and probably on other architectures,
+# for egcs 1.1, if we're using non-local gotos, then we need
+# `-fno-gcse -fno-function-cse'.
+# (Actually I don't know if _both_ of these are needed.
+# Maybe you can get away with just one of them.)
+# Earlier versions of gcc will just ignore those arguments,
+# so we don't need to conditionalize that on the gcc version.
+#
 # For Irix 5, gcc labels don't work with shared libraries,
 # so if we're using gcc labels, we need to use non-shared libraries,
 # which means passing -non_shared and -mno-abicalls and also setting
 # LIBRARY_PATH.
+#
 # For x86, gcc global registers only work with -fno-builtin
 # and -fno-omit-frame-pointer.
 #
@@ -1160,11 +1169,11 @@
 save_CC="$CC"
 save_LIBRARY_PATH="$LIBRARY_PATH"
 CFLAGS_FOR_REGS=
-CFLAGS_FOR_GOTOS=-fno-defer-pop
+CFLAGS_FOR_GOTOS=-fno-defer-pop -fno-function-cse -fno-gcse
 case "$host" in
 	mips-sgi-irix5.*)
 		CC="$CC -non_shared -mno-abicalls"
-		CFLAGS_FOR_GOTOS="-fno-defer-pop -non_shared -mno-abicalls"
+		CFLAGS_FOR_GOTOS="$CFLAGS_FOR_GOTOS -non_shared -mno-abicalls"
 LIBRARY_PATH="$NONSHARED_LIB_DIR:/usr/lib/nonshared:$LIBRARY_PATH"
 		export LIBRARY_PATH
 		;;
@@ -1183,7 +1192,7 @@
 		MERCURY_MSG("but plain gcc labels do not")
 		mercury_cv_asm_labels=yes
 		mercury_cv_gcc_labels=no
-		CFLAGS_FOR_GOTOS="-fno-defer-pop -fomit-frame-pointer"
+		CFLAGS_FOR_GOTOS="$CFLAGS_FOR_GOTOS -fomit-frame-pointer"
 		;;
 	# Similarly for rs6000
 	rs6000-*)
@@ -1193,15 +1202,10 @@
 		;;
 	sparc*)
 		case "`$CC --version`" in
-		    egcs*)
-		    	# I don't know if _both_ of these are needed
-			CFLAGS_FOR_GOTOS="-fno-gcse -fno-function-cse"
-			;;
 		    gcc-2.8*)
 			AC_MSG_WARN(*** Mercury might not work with " \
 				"gcc 2.8 on sparc!)
 			AC_MSG_WARN(We advise using gcc 2.7.x or egcs.)
-			CFLAGS_FOR_GOTOS="-fno-function-cse"
 			;;
 		esac
 		;;

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the developers mailing list