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
#include "textflag.h"
#include "funcdata.h"
DATA bInitX<>+0x00(SB)/8, $0x0000000100000000
DATA bInitX<>+0x08(SB)/8, $0x0000000300000002
DATA bInitX<>+0x10(SB)/8, $0x0000000500000004
DATA bInitX<>+0x18(SB)/8, $0x0000000700000006
DATA bInitX<>+0x20(SB)/8, $0x0000000900000008
DATA bInitX<>+0x28(SB)/8, $0x0000000B0000000A
DATA bInitX<>+0x30(SB)/8, $0x0000000D0000000C
DATA bInitX<>+0x38(SB)/8, $0x0000000F0000000E
GLOBL bInitX<>(SB), (NOPTR+RODATA), $64
// func good()
TEXT ·good(SB), NOSPLIT, $0
NO_LOCAL_POINTERS
VMOVUPS bInitX<>+0(SB), Z0
RET
// func bad()
TEXT ·bad(SB), NOSPLIT, $0
NO_LOCAL_POINTERS
VMOVUPS bInitX<>+0(SB), Z8
RET
What did you expect to see?
The program should run correctly and exit cleanly.
Note that there is an extra 00 byte inserted after the ModR/M byte (05). This leads to an incorrect relative address being encoded into the instruction and the corruption of the subsequent instruction. Instead of a retq we now have an add.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (and on master (go version devel +c1320ec Fri Mar 22 08:51:29 2019 +0100 linux/amd64))
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I built and ran the following on a SkylakeX Core i9 that supports AVX512 instructions
main.go
bug.s
What did you expect to see?
The program should run correctly and exit cleanly.
What did you see instead?
Analysis
Looking at the disassembly in objdump it's easy to see what the problem is. The first VMOVUPS instruction
VMOVUPS bInitX<>+0(SB), Z0
is assembled correctly, while the second
VMOVUPS bInitX<>+0(SB), Z8
is not.
Note that there is an extra 00 byte inserted after the ModR/M byte (05). This leads to an incorrect relative address being encoded into the instruction and the corruption of the subsequent instruction. Instead of a retq we now have an add.
The text was updated successfully, but these errors were encountered: