[commit: ghc] master: Fix AIX/ppc codegen in `-prof` compilation mode (61df7f8)

git at git.haskell.org git at git.haskell.org
Sun Mar 27 21:46:07 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/61df7f8fb4e76fc8987c0b4f02aa9ec795be7afb/ghc

>---------------------------------------------------------------

commit 61df7f8fb4e76fc8987c0b4f02aa9ec795be7afb
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sun Mar 27 23:41:12 2016 +0200

    Fix AIX/ppc codegen in `-prof` compilation mode
    
    The implementation in df26b95559fd467abc0a3a4151127c95cb5011b9
    wrongly assumed that all C-ABI subroutine calls would use a
    'ForeignLabel' but it turns out that calls inserted via
    'emitRtsCall' use 'CmmLabel's instead.


>---------------------------------------------------------------

61df7f8fb4e76fc8987c0b4f02aa9ec795be7afb
 compiler/nativeGen/PPC/Ppr.hs | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs
index 16e8dc1..59b0ad8 100644
--- a/compiler/nativeGen/PPC/Ppr.hs
+++ b/compiler/nativeGen/PPC/Ppr.hs
@@ -607,10 +607,16 @@ pprInstr (BCTR _ _) = hcat [
     ]
 pprInstr (BL lbl _) = do
     sdocWithPlatform $ \platform -> case platformOS platform of
-        OSAIX | isForeignLabel lbl ->
+        OSAIX ->
           -- On AIX, "printf" denotes a function-descriptor (for use
           -- by function pointers), whereas the actual entry-code
-          -- address is denoted by the dot-prefixed ".printf" label
+          -- address is denoted by the dot-prefixed ".printf" label.
+          -- Moreover, the PPC NCG only ever emits a BL instruction
+          -- for calling C ABI functions. Most of the time these calls
+          -- originate from FFI imports and have a 'ForeignLabel',
+          -- but when profiling the codegen inserts calls via
+          -- 'emitRtsCallGen' which are 'CmmLabel's even though
+          -- they'd technically be more like 'ForeignLabel's.
           hcat [
             text "\tbl\t.",
             ppr lbl



More information about the ghc-commits mailing list