[GHC] #12965: String merging broken on Windows

GHC ghc-devs at haskell.org
Mon Nov 26 22:57:00 UTC 2018


#12965: String merging broken on Windows
---------------------------------+----------------------------------------
        Reporter:  bgamari       |                Owner:  (none)
            Type:  bug           |               Status:  upstream
        Priority:  normal        |            Milestone:  8.8.1
       Component:  Compiler      |              Version:  8.0.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):  Phab:D3384
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by Phyx-):

 The specific implementation in GCC/binutils won't work for non-ELF targets
 it turns out. However I have an implementation that should do this using a
 similar method as the D compiler uses by leveraging ld's `.gnu.linkonce`
 support for PE targets.

 This method however needs a guarantee from the compiler that it doesn't
 output duplicate string constants, or GAS will end up merging them and
 breaking the approach. (This is what was going wrong in the Diff as WIP on
 Phab).

 It seems that GHC doesn't do this at the moment, it only happens to have
 this effect some of the them due to CSEing.

 So I have written a new string constant pooling pass that does this. In
 order to make it lightweight I changed the syntax to allow multiple labels
 at definition site.

 Such that I don't have to actually change the usage sites. I've changed
 all the back-ends but have a bug to fix and still need to figure out how
 to test the llvm, macos and unregister changes.

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


More information about the ghc-tickets mailing list