diff --git a/src/cmd/compile/internal/walk/walk.go b/src/cmd/compile/internal/walk/walk.go index d889786c728..1f0b7772634 100644 --- a/src/cmd/compile/internal/walk/walk.go +++ b/src/cmd/compile/internal/walk/walk.go @@ -14,6 +14,7 @@ import ( "cmd/compile/internal/ssagen" "cmd/compile/internal/typecheck" "cmd/compile/internal/types" + "cmd/internal/objabi" "cmd/internal/src" ) @@ -203,6 +204,13 @@ func mapfast(t *types.Type) int { } switch reflectdata.AlgType(t.Key()) { case types.AMEM32: + if objabi.Experiment.RegabiArgs && t.Key().NumComponents(types.CountBlankFields) != 1 { + // If key has multiple components, under register ABI it will + // be passed differently than uint32. + // TODO: maybe unsafe-case to uint32. But needs to make the type + // checker happy. + return mapslow + } if !t.Key().HasPointers() { return mapfast32 } @@ -211,6 +219,10 @@ func mapfast(t *types.Type) int { } base.Fatalf("small pointer %v", t.Key()) case types.AMEM64: + if objabi.Experiment.RegabiArgs && t.Key().NumComponents(types.CountBlankFields) != 1 { + // See above. + return mapslow + } if !t.Key().HasPointers() { return mapfast64 }