[m-dev.] diff: port to latest gcc

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Nov 26 00:04:15 AEDT 2000


Estimated hours taken: 0.5

runtime/mercury_goto.h:
	Fix an incompatibility with the latest snapshot version of
	gcc; the syntax for registers in inline assember is slightly
	different.

Workspace: /home/pgrad/fjh/ws/hg3
Index: runtime/mercury_goto.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_goto.h,v
retrieving revision 1.26
diff -u -d -u -b -r1.26 mercury_goto.h
--- mercury_goto.h	2000/11/23 02:00:29	1.26
+++ mercury_goto.h	2000/11/25 05:07:58
@@ -216,11 +216,25 @@
     */
     #if defined(__i386__)
 
+      #if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 97
+        /*
+	** The gcc 2.97 snapshot that I tried didn't convert
+	** "%%" in inline asm into "%".  So for gcc >= 2.97,
+	** just use one % symbol.
+	** (This behaviour is contrary to the gcc manual, but
+	** using %% like it says in the manual doesn't work,
+	** so we have to use %.)
+	*/
+        #define MR_EBX "%ebx"
+      #else
+        #define MR_EBX "%%ebx"
+      #endif
+
       #define MR_INLINE_ASM_FIXUP_REGS     			\
     	"	call 0f\n"     					\
     	"0:\n"       						\
-    	"	popl %%ebx\n"     				\
-    	"	addl $_GLOBAL_OFFSET_TABLE_+[.-0b],%%ebx\n\t"	\
+    	"	popl " MR_EBX "\n"     					\
+    	"	addl $_GLOBAL_OFFSET_TABLE_+[.-0b]," MR_EBX "\n\t"	\
     		: :
 #if 0
 	/*

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