[m-dev.] diff: work-around for gcc bug

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Jan 28 21:22:45 AEDT 2001


Estimated hours taken: 1

scripts/mgnuc.in:
	Work around a gcc bug that broke library/table_builtin.m when built
	with `MCFLAGS = -O6' and `--intermodule-optimization'. 
	GNU C version egcs-1.1.2 reported the following error message:
		table_builtin.c: In function `table_builtin_module':
		table_builtin.c:1880: fixed or forbidden register 3 (bx)
		was spilled for class GENERAL_REGS.
		This may be due to a compiler bug or to impossible asm
		statements or clauses.
	The work-around is to compile that file with `-O0'.

Workspace: /home/hg/fjh/ws-hg3/mercury
Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.76
diff -u -d -r1.76 mgnuc.in
--- scripts/mgnuc.in	2000/12/01 03:22:20	1.76
+++ scripts/mgnuc.in	2001/01/28 10:16:30
@@ -394,8 +394,10 @@
 # compiler/bytecode.c.  As a work-around, we compile those file with -O1.
 # Similarly library/bag.c needs to be compiled with -O0.
 # Similarly for gcc-2.6.3 on alpha with compiler/modules.c.
+# Similarly for gcc-2.7.0 on i386 with compiler/call_gen.c.
 # Similarly for egcs-1.1 on sparc with library/lexer.c, library/string.c,
 # and compiler/{deforest,dupelim,mercury_to_mercury,modules}.c.
+# Similarly for egcs-1.1.2 on i386 with library/table_builtin.c.
 #
 case $COMPILER in gcc)
 	case "$FULLARCH" in
@@ -424,6 +426,8 @@
 		i?86*)
 			case "$*" in
 			*" call_gen.c "*|*" modules.dir/call_gen"*".c "*)
+				ARCH_OPTS="$ARCH_OPTS -O0" ;;
+			*" table_builtin.c "*|*" modules.dir/table_builtin"*".c "*)
 				ARCH_OPTS="$ARCH_OPTS -O0" ;;
 			esac ;;
 		sparc*)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list