[project @ 2002-08-21 22:06:02 by ken]
authorken <unknown>
Wed, 21 Aug 2002 22:06:03 +0000 (22:06 +0000)
committerken <unknown>
Wed, 21 Aug 2002 22:06:03 +0000 (22:06 +0000)
Use __DISCARD__ to prevent overly aggressive optimization by certain
gcc versions on the Alpha.  Thanks to Jeffrey Lewis!

ghc/driver/mangler/ghc-asm.lprl
ghc/includes/TailCalls.h

index 424477e..1edd32f 100644 (file)
@@ -843,6 +843,7 @@ sub mangle_asm {
 
        # toss all calls to __DISCARD__
        $c =~ s/^\t(call|jbsr|jal)\s+${T_US}__DISCARD__\n//go;
+       $c =~ s/^\tjsr\s+\$26\s*,\s*${T_US}__DISCARD__\n//go if $TargetPlatform =~ /^alpha-/;
        $c =~ s/^\tbl\s+L___DISCARD__\$stub\n//go if $TargetPlatform =~ /^powerpc-apple-.*/;
 
        # IA64: mangle tailcalls into jumps here
index 2d3f36c..1e52be5 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: TailCalls.h,v 1.10 2002/06/03 13:08:41 matthewc Exp $
+ * $Id: TailCalls.h,v 1.11 2002/08/21 22:06:03 ken Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -85,9 +85,10 @@ extern void __DISCARD__(void);
 
 register void *_procedure __asm__("$27");
 
-#define JMP_(cont)                             \
-    do { _procedure = (void *)(cont);          \
-         goto *_procedure;                     \
+#define JMP_(cont)                             \
+    do { _procedure = (void *)(cont);          \
+         __DISCARD__();                                \
+         goto *_procedure;                     \
        } while(0)
 
 /* Don't need these for alpha mangling */