]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: give function position on function-too-big error
authorKeith Randall <khr@golang.org>
Mon, 10 Jun 2024 16:52:33 +0000 (09:52 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 22 Jul 2024 21:20:26 +0000 (21:20 +0000)
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>

src/cmd/compile/internal/bitvec/bv.go
src/cmd/compile/internal/liveness/arg.go
src/cmd/compile/internal/liveness/plive.go

index ad7ed0a1965e9c064e2dddf0f19125dfd4fe7ed4..aab10433c8f181d6ce6873f70d337d02998baf43 100644 (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),
index e1269a10b73900c8bc2f1b236e6e594f94bde319..77960f5e15a1f9314f51c638379f84ed5059834e 100644 (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()
index 708f0f20235daae61d567e36e861bd8e88f3d0a1..c5003ddca6b8307d9579e06297d6c13c9136f0aa 100644 (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)