[GHC] #9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code

GHC ghc-devs at haskell.org
Fri Aug 15 15:56:09 UTC 2014


#9439: LlvmCodegen: Overzealous mangler incorrectly transforms user code
-------------------------------------+-------------------------------------
              Reporter:  bgamari     |            Owner:  rwbarton
                  Type:  bug         |           Status:  new
              Priority:  highest     |        Milestone:  7.8.4
             Component:  Compiler    |          Version:  7.8.2
  (LLVM)                             |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:  9268        |
Differential Revisions:  Phab:D150   |
-------------------------------------+-------------------------------------

Comment (by Reid Barton <rwbarton@…>):

 In [changeset:"5895f2b8ffba72a8393e9f712461e6e5ed7ceced/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="5895f2b8ffba72a8393e9f712461e6e5ed7ceced"
 LlvmMangler: Be more selective when mangling object types

 Summary:
 We previously did a wholesale replace of `%function` to `%object` to
 mangle object `.type` annotations. This is bad as it can end up
 replacing appearances of `"%function"` in the user's code. We now look
 for a proper `.type` keyword before performing the replacement.

 Thanks to @rwbarton for pointing out the bug.

 Test Plan:
 Previously,

     $ echo 'main = putStrLn "@function"' > test.hs
     $ ghc -fllvm test.hs
     $ ./test
     @object

 Now,
     $ echo 'main = putStrLn "@function"' > test.hs
     $ ghc -fllvm test.hs
     $ ./test
     @function

 Reviewers: rwbarton, austin

 Reviewed By: rwbarton, austin

 Subscribers: phaskell, simonmar, relrod, ezyang, carter

 Differential Revision: https://phabricator.haskell.org/D150

 GHC Trac Issues: #9439
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9439#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list