Skip to content

cmd/compile: miscompilation of partially-overlapping array assignments #54467

@mdempsky

Description

@mdempsky

https://go.dev/play/p/QL9pJw6LY9e

When p and q are pointers to arrays, the behavior of *p = *q should be as if *q is fully evaluated before any assignments through *p take effect.

The above program however demonstrates (at least on GOARCH=amd64) that when they're pointers to partially-overlapping arrays, the evaluation of *q and assignments through *p are interleaved.

/cc @golang/compiler

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.compiler/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