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]

Fix compilation to native x86-64 compiler


This patch is needed to be able to compile with --host=x86_64-unknown-linux 
(and other OSes too, I expect).

Originally I wanted to make the ifdef test if gcc was compiling to x86 or 
x86-64 at runtime (which means when compiling stuff here - confusing, right?) 
so when compiling for x86 (-m32) on x86-64 would work the same way as on 
native x86, but I was told not to bother with it.

So here is a patch that simply removes the macros from an x86-64 compiler.

2001-11-30  Bo Thorsen  <bo@suse.co.uk>

	* config/i386/i386.h (MACHINE_STATE_SAVE): Disable for x86-64.
	(MACHINE_STATE_RESTORE): Likewise.


Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.218
diff -u -r1.218 i386.h
--- i386.h      2001/11/15 17:55:27     1.218
+++ i386.h      2001/11/30 13:37:39
@@ -1770,8 +1770,14 @@
    in the BLOCK_PROFILER macro.

    Note that ebx, esi, and edi are callee-save, so we don't have to
-   preserve them explicitly.  */
+   preserve them explicitly.

+   These macros are not needed for x86-64.  */
+
+#ifdef __x86_64__
+#define MACHINE_STATE_SAVE(ID)
+#define MACHINE_STATE_RESTORE(ID)
+#else
 #define MACHINE_STATE_SAVE(ID)                                 \
 do {                                                           \
   register int eax_ __asm__("eax");                            \
@@ -1795,6 +1801,7 @@
 pop{l} %0"                                                     \
        : "=r"(eax_), "=r"(ecx_), "=r"(edx_));                  \
 } while (0);
+#endif

 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
    the stack pointer does not matter.  The value is tested only in

Bo.

-- 

     Bo Thorsen                 |   Praestevejen 4
     Free software developer    |   5290 Marslev
     SuSE Labs                  |   Denmark


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