Skip to content

cmd/compile: unaligned stores to global variables on s390x (causes SIGILL or relocation error) #21048

@mundaym

Description

@mundaym

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

go1.9beta2 (also present in go1.8.3)

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

linux/s390x

What did you do?

package main

type T struct {
	a [1]byte
	b [2]byte
}

var x T

//go:noinline
func newT() T {
	return T{[1]byte{1}, [2]byte{1,2}}
}

func main() {
	x.b = newT().b
}

(https://play.golang.org/p/jXSguFs4Hk)

What did you expect to see?

Successful execution.

What did you see instead?

main.main: main.x+1054942 is not 2-byte aligned

While not strictly a regression from the last release, this bug does cause the docker tests to fail when using go1.9beta2. I have a somewhat ugly fix, will send a CL shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions