fix a warning
[ghc-hetmet.git] / ghc / rts / StgCRun.c
index b1e2724..c1afc16 100644 (file)
@@ -145,12 +145,12 @@ StgRun(StgFunPtr f, StgRegTable *basereg) {
         */
         "movl %2,%%eax\n\t"
         
-#if darwin_TARGET_OS
        /*
-        * Darwin: keep the stack aligned
+        * Darwin note:
+        * The stack pointer has to be aligned to a multiple of 16 bytes at
+        * this point. This works out correctly with gcc 4.0.1, but it might
+        * break at any time in the future. TODO: Make this future-proof.
         */
-        "subl $12,%%esp\n\t"
-#endif
 
        /*
         * jump to it
@@ -160,13 +160,6 @@ StgRun(StgFunPtr f, StgRegTable *basereg) {
        STG_GLOBAL STG_RETURN "\n"
                STG_RETURN ":\n\t"
 
-#if darwin_TARGET_OS
-       /*
-        * Darwin: keep the stack aligned
-        */
-        "addl $12,%%esp\n\t"
-#endif
-
        "movl %%esi, %%eax\n\t"   /* Return value in R1  */
 
        /*
@@ -203,8 +196,8 @@ StgRun(StgFunPtr f, StgRegTable *basereg) {
 
 extern StgRegTable * StgRun(StgFunPtr f, StgRegTable *basereg);
 
-void StgRunIsImplementedInAssembler(void);
-void StgRunIsImplementedInAssembler(void)
+static void GNUC3_ATTRIBUTE(used)
+StgRunIsImplementedInAssembler(void)
 {
     __asm__ volatile (
        /*
@@ -629,7 +622,8 @@ void StgRunIsImplementedInAssembler(void)
 // *) The Link Register is saved to a different offset in the caller's stack frame
 //    (Linux: 4(r1), Darwin 8(r1))
 
-static void StgRunIsImplementedInAssembler(void)
+static void GNUC3_ATTRIBUTE(used)
+StgRunIsImplementedInAssembler(void)
 {
        __asm__ volatile (
                "\t.globl StgRun\n"
@@ -708,7 +702,8 @@ static void StgRunIsImplementedInAssembler(void)
 #ifdef linux_HOST_OS
 extern StgRegTable * StgRun(StgFunPtr f, StgRegTable *basereg);
 
-static void StgRunIsImplementedInAssembler(void)
+static void GNUC3_ATTRIBUTE(used)
+StgRunIsImplementedInAssembler(void)
 {
         // r0 volatile
        // r1 stack pointer
@@ -858,7 +853,8 @@ static void StgRunIsImplementedInAssembler(void)
 #define LOCALS 31
 #endif
 
-static void StgRunIsImplementedInAssembler(void)
+static void GNUC3_ATTRIBUTE(used)
+StgRunIsImplementedInAssembler(void)
 {
     __asm__ volatile(
                ".global StgRun\n"