
#9142: LLVM HEAD rejects aliases used by LLVM codegen -------------------------------------+------------------------------------ Reporter: bgamari | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by bgamari): There are two cases to worry about here, as shown in [https://github.com/ghc/ghc/blob/a948fe838bc79363d7565033d6ee42bf24d52fdc/com... generateAliases], 1. The case of an externally defined symbol where we don't know the type (where `m_ty` is `Nothing`) 2. The case of a symbol for which we have a definition and therefore a type Case 1 can be handled with something like the attached patch. Frustratingly, case 2 cannot be as LLVM already knows the type and [https://github.com/llvm- mirror/llvm/blob/68b0d1d2b47f1be8eec2ce57c8119906c354ccd8/lib/AsmParser/LLParser.cpp#L692 refuses] to accept that we know what we are doing when we attempt to cast to a `i8*` (e.g. with a `bitcast` or `inttoptr`/`ptrtoint`). It seems that this will require an upstream fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9142#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler