Skip to content

"Naughty" register error in Cmm

When experimenting with Cmm code, I found the following bug/trap.

This Cmm code,

foo {
    bits8 x;
    x = 5;
    bits8[12] = x;
    R1 = x;
    jump bar;
}

causes the following error

/tmp/ghc6613_0/ghc6613_0.s: Assembler messages:

/tmp/ghc6613_0/ghc6613_0.s:7:0:
     Error: junk `naughty I386 byte register' after expression

The assembly that is produced is:

.text
        .align 4,0x90
.globl foo
foo:
        movl $5,%eax
        movb %al,12
        movb %al,very naughty I386 byte register
        jmp bar

.section .note.GNU-stack,"",@progbits
.ident "GHC 6.7.20070612"

Note the "very naughty I386 byte register" in there.

I am not sure whether this kind of Cmm can be generated from Haskell code.

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