1
0
mirror of https://github.com/golang/go synced 2024-11-26 18:06:55 -07:00

cmd/compile: give function position on function-too-big error

Update #67916

Change-Id: Iec3603c136b30ff6f760783c175eeb7e6ce139ec
Reviewed-on: https://go-review.googlesource.com/c/go/+/591675
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
This commit is contained in:
Keith Randall 2024-06-10 09:52:33 -07:00 committed by Gopher Robot
parent e061fb89e8
commit afe0e60054
3 changed files with 5 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import (
"math/bits"
"cmd/compile/internal/base"
"cmd/internal/src"
)
const (
@ -33,11 +34,11 @@ type Bulk struct {
nword int32
}
func NewBulk(nbit int32, count int32) Bulk {
func NewBulk(nbit int32, count int32, pos src.XPos) Bulk {
nword := (nbit + wordBits - 1) / wordBits
size := int64(nword) * int64(count)
if int64(int32(size*4)) != size*4 {
base.Fatalf("NewBulk too big: nbit=%d count=%d nword=%d size=%d", nbit, count, nword, size)
base.FatalfAt(pos, "NewBulk too big: nbit=%d count=%d nword=%d size=%d", nbit, count, nword, size)
}
return Bulk{
words: make([]uint32, size),

View File

@ -132,7 +132,7 @@ func ArgLiveness(fn *ir.Func, f *ssa.Func, pp *objw.Progs) (blockIdx, valueIdx m
}
nargs := int32(len(lv.args))
bulk := bitvec.NewBulk(nargs, int32(len(f.Blocks)*2))
bulk := bitvec.NewBulk(nargs, int32(len(f.Blocks)*2), fn.Pos())
for _, b := range f.Blocks {
be := &lv.be[b.ID]
be.livein = bulk.Next()

View File

@ -431,7 +431,7 @@ func newliveness(fn *ir.Func, f *ssa.Func, vars []*ir.Name, idx map[*ir.Name]int
nblocks := int32(len(f.Blocks))
nvars := int32(len(vars))
bulk := bitvec.NewBulk(nvars, nblocks*7)
bulk := bitvec.NewBulk(nvars, nblocks*7, fn.Pos())
for _, b := range f.Blocks {
be := lv.blockEffects(b)