summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2016-03-27 23:41:12 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2016-03-27 23:46:41 +0200
commit61df7f8fb4e76fc8987c0b4f02aa9ec795be7afb (patch)
treeeb2e2ea2830cd68165c1ea268ba8d68158917a59 /compiler/nativeGen
parentc7b32ad55f4a6ec59f431f47ac2a8a9099f87ab7 (diff)
downloadhaskell-61df7f8fb4e76fc8987c0b4f02aa9ec795be7afb.tar.gz
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.
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r--compiler/nativeGen/PPC/Ppr.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs
index 16e8dc14e0..59b0ad80d1 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