]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix typing of IData opcodes
authorKeith Randall <khr@google.com>
Tue, 29 Oct 2019 20:14:58 +0000 (13:14 -0700)
committerKeith Randall <khr@golang.org>
Tue, 29 Oct 2019 21:21:09 +0000 (21:21 +0000)
commit70331a31ed04144094f77a94676512d8829d84e2
tree87c676d991fcef85f41a82689acc41724083dcfc
parent1fb7d5472e8f46faaa034fe6e16ca66a1e7c766f
cmd/compile: fix typing of IData opcodes

The rules for extracting the interface data word don't leave
the result typed correctly. If I do i.([1]*int)[0], the result
should have type *int, not [1]*int. Using (IData x) for the result
keeps the typing of the original top-level Value.

I don't think this would ever cause a real codegen bug, bug fixing it
at least makes the typing shown in ssa.html more consistent.

Change-Id: I239d821c394e58347639387981b0510d13b2f7b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/204042
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/rewritegeneric.go