diff options
Diffstat (limited to 'src/cmd/compile/internal/ssagen/pgen.go')
-rw-r--r-- | src/cmd/compile/internal/ssagen/pgen.go | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/cmd/compile/internal/ssagen/pgen.go b/src/cmd/compile/internal/ssagen/pgen.go index 0088f10fa8..8fa5980dab 100644 --- a/src/cmd/compile/internal/ssagen/pgen.go +++ b/src/cmd/compile/internal/ssagen/pgen.go @@ -104,9 +104,7 @@ func (s *ssafn) AllocFrame(f *ssa.Func) { // Reassign stack offsets of the locals that are used. lastHasPtr := false for i, n := range fn.Dcl { - if n.Op() != ir.ONAME || n.Class != ir.PAUTO && !(n.Class == ir.PPARAMOUT && n.IsOutputParamInRegisters()) { - // i.e., stack assign if AUTO, or if PARAMOUT in registers (which has no predefined spill locations) - // TODO figure out when we don't need to spill output params. + if n.Op() != ir.ONAME || n.Class != ir.PAUTO { continue } if !n.Used() { @@ -150,9 +148,9 @@ const maxStackSize = 1 << 30 func Compile(fn *ir.Func, worker int) { f := buildssa(fn, worker) // Note: check arg size to fix issue 25507. - if f.Frontend().(*ssafn).stksize >= maxStackSize || f.OwnAux.ArgWidth() >= maxStackSize { + if f.Frontend().(*ssafn).stksize >= maxStackSize || fn.Type().ArgWidth() >= maxStackSize { largeStackFramesMu.Lock() - largeStackFrames = append(largeStackFrames, largeStack{locals: f.Frontend().(*ssafn).stksize, args: f.OwnAux.ArgWidth(), pos: fn.Pos()}) + largeStackFrames = append(largeStackFrames, largeStack{locals: f.Frontend().(*ssafn).stksize, args: fn.Type().ArgWidth(), pos: fn.Pos()}) largeStackFramesMu.Unlock() return } @@ -168,7 +166,7 @@ func Compile(fn *ir.Func, worker int) { if pp.Text.To.Offset >= maxStackSize { largeStackFramesMu.Lock() locals := f.Frontend().(*ssafn).stksize - largeStackFrames = append(largeStackFrames, largeStack{locals: locals, args: f.OwnAux.ArgWidth(), callee: pp.Text.To.Offset - locals, pos: fn.Pos()}) + largeStackFrames = append(largeStackFrames, largeStack{locals: locals, args: fn.Type().ArgWidth(), callee: pp.Text.To.Offset - locals, pos: fn.Pos()}) largeStackFramesMu.Unlock() return } @@ -191,12 +189,6 @@ func StackOffset(slot ssa.LocalSlot) int32 { n := slot.N var off int64 switch n.Class { - case ir.PPARAM, ir.PPARAMOUT: - if !n.IsOutputParamInRegisters() { - off = n.FrameOffset() + base.Ctxt.FixedFrameSize() - break - } - fallthrough // PPARAMOUT in registers allocates like an AUTO case ir.PAUTO: off = n.FrameOffset() if base.Ctxt.FixedFrameSize() == 0 { @@ -205,6 +197,8 @@ func StackOffset(slot ssa.LocalSlot) int32 { if objabi.Framepointer_enabled { off -= int64(types.PtrSize) } + case ir.PPARAM, ir.PPARAMOUT: + off = n.FrameOffset() + base.Ctxt.FixedFrameSize() } return int32(off + slot.Off) } |