From 5c553db9d741134647ed8e70aa4e4b447ca0dbe0 Mon Sep 17 00:00:00 2001 From: ken Date: Wed, 21 Aug 2002 22:06:03 +0000 Subject: [PATCH] [project @ 2002-08-21 22:06:02 by ken] Use __DISCARD__ to prevent overly aggressive optimization by certain gcc versions on the Alpha. Thanks to Jeffrey Lewis! --- ghc/driver/mangler/ghc-asm.lprl | 1 + ghc/includes/TailCalls.h | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ghc/driver/mangler/ghc-asm.lprl b/ghc/driver/mangler/ghc-asm.lprl index 424477e..1edd32f 100644 --- a/ghc/driver/mangler/ghc-asm.lprl +++ b/ghc/driver/mangler/ghc-asm.lprl @@ -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 diff --git a/ghc/includes/TailCalls.h b/ghc/includes/TailCalls.h index 2d3f36c..1e52be5 100644 --- a/ghc/includes/TailCalls.h +++ b/ghc/includes/TailCalls.h @@ -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 */ -- 1.7.10.4