You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. What is a short input program that triggers the error?
package main
func main() {
x := []uint{0}
x[0] &^= f()
}
func f() uint {
return 1<<31 // doesn't panic with 1<<31 - 1
}
2. What is the full compiler output?
unexpected fault address 0x80000000
throw: fault
panic PC=0x7f8721298048
runtime.throw+0x3b /home/sni/go/src/pkg/runtime/runtime.c:73
runtime.throw(0x42385e, 0x80000000)
runtime.sigpanic+0xe7 /home/sni/go/src/pkg/runtime/linux/thread.c:288
runtime.sigpanic()
main.main+0x69 /home/sni/Work/book/bitset/testAndNotAssignment.go:5
main.main()
runtime.mainstart+0xf /home/sni/go/src/pkg/runtime/amd64/asm.s:77
runtime.mainstart()
runtime.goexit /home/sni/go/src/pkg/runtime/proc.c:148
runtime.goexit()
3. What version of the compiler are you using? (Run it with the -V flag.)
6g version 7045+
The text was updated successfully, but these errors were encountered:
This is not an internal compiler error, just bad generated code. That is, the compiler
doesn't fault, the compiled program does. However, this is a nice short example of the
bug; thanks for that.
Here's the generated code around the call to f(). Looks like BX is being used without
being saved.
0014 (x.go:5) MOVQ (BX),BX
0015 (x.go:5) CALL ,f+0(SB)
0016 (x.go:5) MOVL (SP),R8
0017 (x.go:5) XORL $-1,R8
0018 (x.go:5) ANDL R8,(BX) // this instruction faults
by snilsson@nada.kth.se:
The text was updated successfully, but these errors were encountered: