Skip to content

cmd/compile: ppc64le: sign extension issue in go 1.21rc2 #61297

@eliben

Description

@eliben

Reported by Jan Mercl on golang-dev@

What version of Go are you using (go version)?

$ go version
go version go1.21rc2 linux/ppc64le

What operating system and processor architecture are you using (go env)?

$ uname -a
        Linux sqlite1 5.10.0-18-powerpc64le #1 SMP Debian 5.10.140-1 (2022-09-02) ppc64le GNU/Linux

What did you do?

Minimized reproducer at https://go.dev/play/p/ccmhhPkt0PI?v=gotip outputs

        55282
        55282

in the playground. Running the same code on linux/ppc64le:

        debian@sqlite1:~/tmp$ cat bug.go
        package main
       
        import (
                "fmt"
                "strconv"
        )
       
        func f(n int) int8 {
                return int8(n)
        }
       
        func main() {
                n, _ := strconv.Atoi("9")
                fmt.Println(int64(0xd7f2) & int64(f(-n)))
                fmt.Println(int64(0xd7f2) & int64(f(-9)))
        }

        debian@sqlite1:~/tmp$ go run bug.go
        242
        55282

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.arch-ppc64xcompiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions