[project @ 2004-09-24 16:29:33 by wolfgang]
authorwolfgang <unknown>
Fri, 24 Sep 2004 16:29:33 +0000 (16:29 +0000)
committerwolfgang <unknown>
Fri, 24 Sep 2004 16:29:33 +0000 (16:29 +0000)
PowerPC/Mac OS X:
Improve epilogue mangling.
This became necesssary because the new CG may "fall through" for cases in
a switch that are known to never happen, so GCC generates the epilogue code
again. With the previous CG, GCC never generated any epilog code, because
every function ended with an unconditional tail jump.

ghc/driver/mangler/ghc-asm.lprl

index 20c6268..be72f7f 100644 (file)
@@ -851,8 +851,8 @@ sub mangle_asm {
                    $e =~ s/^\tj\t\$31\n//;
                } elsif ($TargetPlatform =~ /^powerpc-apple-.*/) {
                    $e =~ s/^\taddi r1,r1,\d+\n//;
-                   $e =~ s/^\tcal r1,\d+\(r1\)\n//;
-                   $e =~ s/^\tlw?z? r\d+,\d+\(r1\)\n//; 
+                   $e =~ s/^\tlwz r\d+,\d+\(r1\)\n//; 
+                   $e =~ s/^\tlmw r\d+,-\d+\(r1\)\n//;
                    $e =~ s/^\tmtlr r0\n//;
                    $e =~ s/^\tblr\n//;
                    $e =~ s/^\tb restFP ;.*\n//;