Skip to content

cmd/compile: assembly listing (-S flag) reports "<unknown line number>" #16214

@ALTree

Description

@ALTree

Code:

package foo

func Mod32(x uint32) uint32 {
    return x % 3
}

func Mod64(x uint64) uint64 {
    return x % 3
}

build -gcflags -S, on tip, outputs:

"".Mod32 t=1 size=27 args=0x10 locals=0x0
    [cut]
    0x0000 00000 (/home/alberto/Desktop/rand.go:3)  FUNCDATA    $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
    0x0000 00000 (/home/alberto/Desktop/rand.go:4)  MOVL    "".x+8(FP), AX
    0x0004 00004 (<unknown line number>)    MOVL    $-1431655765, CX
    0x0009 00009 (/home/alberto/Desktop/rand.go:4)  MULL    CX
    0x000b 00011 (/home/alberto/Desktop/rand.go:4)  SHRL    $1, DX
    [cut]

"".Mod64 t=1 size=34 args=0x10 locals=0x0
    [cut]
    0x0000 00000 (/home/alberto/Desktop/rand.go:7)  FUNCDATA    $0, gclocals·23e8278e2b69a3a75fa59b23c49ed6ad(SB)
    0x0000 00000 (/home/alberto/Desktop/rand.go:7)  FUNCDATA    $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
    0x0000 00000 (/home/alberto/Desktop/rand.go:8)  MOVQ    $-6148914691236517205, AX
    0x000a 00010 (/home/alberto/Desktop/rand.go:8)  MOVQ    "".x+8(FP), CX
    0x000f 00015 (/home/alberto/Desktop/rand.go:8)  MULQ    CX
    [cut]

note the <unknown line number> in the Mod32 disassembly. Note that Mod64 is fine.

This is an SSA regression: on go1.6.2, and on tip with -ssa=0, every instruction gets its own line number.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions