Skip to content

Commit 7439ba3

Browse files
committed
cmd/compile: respect Node.Bounded when inserting OpArraySelect
This triggers 119 times during make.bash. This CL reduces the time it takes for the compiler to panic while compiling the code in #19751 from 22 minutes to 15 minutes. Yay, I guess. Updates #19751 Change-Id: I8ca7f1ae75f89d1eb2a361d67b3055a975221734 Reviewed-on: https://go-review.googlesource.com/39294 Run-TryBot: Josh Bleecher Snyder <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent 9d5987d commit 7439ba3

File tree

1 file changed

+3
-1
lines changed
  • src/cmd/compile/internal/gc

1 file changed

+3
-1
lines changed

src/cmd/compile/internal/gc/ssa.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,9 @@ func (s *state) expr(n *Node) *ssa.Value {
19651965
return s.newValue0(ssa.OpUnknown, n.Type)
19661966
}
19671967
i = s.extendIndex(i, panicindex)
1968-
s.boundsCheck(i, s.constInt(Types[TINT], bound))
1968+
if !n.Bounded() {
1969+
s.boundsCheck(i, s.constInt(Types[TINT], bound))
1970+
}
19691971
return s.newValue1I(ssa.OpArraySelect, n.Type, 0, a)
19701972
}
19711973
p := s.addr(n, false)

0 commit comments

Comments
 (0)