Skip to content

'-g' option generates invalid assembly when '*/*' operator is used

Bug is observed when building cpphs-1.19

module A where

x */* y = 42
$ ghc -fforce-recomp A -g
[1 of 1] Compiling A                ( A.hs, A.o )
/tmp/ghc23923_0/ghc_2.s: Assembler messages:

/tmp/ghc23923_0/ghc_2.s:17:0:  Error: bad expression

/tmp/ghc23923_0/ghc_2.s:17:0:
     Warning: missing operand; zero assumed
...

The problem here is the following assembly snippet:

.text
        .align 8
        .loc 1 3 1 /* */* */
        .quad   12884901911
        .quad   0
        .quad   15

Would it be worthwile using ';' as a comment instead? Don't know if it's universally portable.

Trac metadata
Trac field Value
Version 7.10.2-rc2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (CodeGen)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC scpmw
Operating system
Architecture Unknown/Multiple
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information