From b7a0fd6f2bd0b5e29f7d0a46e54358b3770d1f41 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 3 Sep 2002 14:39:06 +0000 Subject: [PATCH] [project @ 2002-09-03 14:39:06 by simonmar] Just hit a problem caused by gcc 3.1+: it uses instructions like movl %esi, 4(%esp) in the prologue, which the mangler wasn't expecting. This might fix problems that other people have been seeing with gcc 3.1 on x86. MERGE TO STABLE --- ghc/driver/mangler/ghc-asm.lprl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ghc/driver/mangler/ghc-asm.lprl b/ghc/driver/mangler/ghc-asm.lprl index e9d6450..f238d91 100644 --- a/ghc/driver/mangler/ghc-asm.lprl +++ b/ghc/driver/mangler/ghc-asm.lprl @@ -700,13 +700,15 @@ sub mangle_asm { $p =~ s/^\tpushl\s+\%edi\n//; $p =~ s/^\tpushl\s+\%esi\n//; $p =~ s/^\tpushl\s+\%ebx\n//; + $p =~ s/^\tmovl\s+\%esi,\s*\d*\(\%esp\)\n//; + $p =~ s/^\tmovl\s+\%edi,\s*\d*\(\%esp\)\n//; $p =~ s/^\tsubl\s+\$\d+,\s*\%esp\n//; $p =~ s/^\tmovl\s+\$\d+,\s*\%eax\n\tcall\s+__alloca\n// if ($TargetPlatform =~ /^.*-cygwin32/); # GCC 3.1 is in the habit of adding spurious writes to the # stack in the prologue. Just to be on the safe side, # chuck these over the fence into the main code. - while ($p =~ /^\tmovl\s+(\$\d+|\%edi),\s*\d*\(\%esp\)\n/) { + while ($p =~ /^\tmovl\s+\$\d+,\s*\d*\(\%esp\)\n/) { # print "Spurious instruction: $&"; $p = $` . $'; $r = $& . $r; -- 1.7.10.4