[GHC] #14966: Symbols in -ddump-asm output don't match real output

GHC ghc-devs at haskell.org
Fri Mar 23 14:09:05 UTC 2018


#14966: Symbols in -ddump-asm output don't match real output
-------------------------------------+-------------------------------------
           Reporter:  terrorjack     |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.5
  (NCG)                              |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Symbols in the .s files generated by NCG are properly Z-encoded, but they
 aren't in the -ddump-asm output. One trivial example:


 {{{
 {-# OPTIONS_GHC -ddump-to-file -ddump-asm -keep-s-files #-}

 module Fact where

 fact :: Int -> Int
 fact 0 = 1
 fact n = n * fact (n - 1)
 }}}


 The contents of Fact.s:


 {{{
 .section .rdata
 .align 1
 .align 1
 r23Y_bytes:
         .asciz "main"
 .section .data
 .align 8
 .align 1
 r24i_closure:
         .quad   ghczmprim_GHCziTypes_TrNameS_con_info
         .quad   r23Y_bytes
 ...
 }}}


 The contents of Fact.dump-asm:


 {{{
 ==================== Asm code ====================
 2018-03-23 14:00:27.8082773 UTC

 .section .rdata
 .align 1
 .align 1
 $trModule1_r23Y_bytes:
         .asciz "main"


 ==================== Asm code ====================
 2018-03-23 14:00:27.8172758 UTC

 .section .data
 .align 8
 .align 1
 $trModule2_r24i_closure:
         .quad   GHC.Types.TrNameS_con_info
         .quad   $trModule1_r23Y_bytes
 ...
 }}}

 This is confirmed on multiple GHC versions, up to 8.5.

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


More information about the ghc-tickets mailing list