cmd/compile: bad types originating from ssa rule to inline memmove #37381
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
generic.rules contains this rule:
The type of the moved object created here often doesn't match the size of the move.
For example, the most common case is copying a few bytes, so, for example,
t.(*types.Type).Elem()
might bebyte
whilesz
is 4. But the size of a byte is 1, not 4.This doesn't matter right now, because the backends don't pay any attention to the type of
Move
, only the size.The right type here is an array type, with elem
t.(*types.Type).Elem()
and boundsz / sizeof(t.(*types.Type).Elem())
. However, for concurrency safety, we cannot create new array types in the backend. (It happens to work with the compiler as it is at the moment, but it is brittle; if you add new optimizations it is easy to end up requiring the size of that new array type, which panics.)I'm not quite sure what we should do here. Maybe just remove the type Aux from Move?
cc @randall77 @cherrymui
The text was updated successfully, but these errors were encountered: