[project @ 2001-03-07 10:27:43 by rrt]
[ghc-hetmet.git] / ghc / driver / mangler / ghc-asm.lprl
index 8e03615..cd4d99a 100644 (file)
@@ -417,6 +417,7 @@ sub mangle_asm {
     $i = 0; $chkcat[0] = 'misc'; $chk[0] = '';
 
     while (<INASM>) {
+       tr/\r//d if $TargetPlatform =~ /-mingw32$/;
        next if $T_STABBY && /^\.stab.*${T_US}__stg_split_marker/o;
        next if $T_STABBY && /^\.stab.*ghc.*c_ID/;
        next if /^\t\.def.*endef$/;
@@ -757,18 +758,9 @@ sub mangle_asm {
                } else {
                    print STDERR "$Pgm: unknown epilogue mangling? $TargetPlatform\n";
                }
-               # HWL HACK: dont die, just print a warning
-               #print stderr "HWL: this should die! Epilogue junk?: $e\n" if $e =~ /^\t[^\.]/
-               #    && $TargetPlatform !~ /^powerpc-/; #ToDo: remove test
 
-               # ** FIXME:
-               # ** chak:
-               #   Commented this out, because it complains about junk that
-               #   is later removed in the FUNNY#END#THING loop - but as I am
-               #   not sure how this could ever have worked, there may be a 
-               #   better solution...
-               #die "Epilogue junk?: $e\n" if $e =~ /^\t[^\.\n]/
-               #    && $TargetPlatform !~ /^powerpc-/; #ToDo: remove test
+               print "WARNING: Epilogue junk?: $e\n" if $e =~ /^\t\s*[^\.\s\n]/
+                  && $TargetPlatform !~ /^powerpc-/; #ToDo: remove test
 
                # glue together what's left
                $c = $r . $e;
@@ -1093,7 +1085,7 @@ sub mangle_asm {
                    # references to fast-entry point.
                    # (questionable re hppa and mips...)
                    print STDERR "still has jump to fast entry point:\n$c"
-                       if $c =~ /${T_US}${symb}_fast/;
+                       if $c =~ /\b${T_US}${symb}_fast/;
                }
 
                print OUTASM $T_HDR_entry;
@@ -1265,8 +1257,7 @@ sub print_doctored {
     #   jmp  *<bad-reg>
     #
 
-# Because of Perl bug, needed separate cases for eax, ebx, ecx, edx in the past
-    s/^\tmovl \$${T_US}(.*),(\%e[abcd]x)\n\tjmp \*$2/\tjmp $T_US$1/g;
+    s/^\tmovl\s+\$${T_US}(.*),(\%e[abcd]x)\n\tjmp\s+\*\2/\tjmp $T_US$1/g;
 
     if ($StolenX86Regs <= 2 ) { # YURGH! spurious uses of esi?
        s/^\tmovl\s+(.*),\s*\%esi\n\tjmp\s+\*%esi\n/\tmovl $1,\%eax\n\tjmp \*\%eax\n/g;