aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/stackalloc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/ssa/stackalloc.go')
-rw-r--r--src/cmd/compile/internal/ssa/stackalloc.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/stackalloc.go b/src/cmd/compile/internal/ssa/stackalloc.go
index 68a6f08a2a..041e7855f6 100644
--- a/src/cmd/compile/internal/ssa/stackalloc.go
+++ b/src/cmd/compile/internal/ssa/stackalloc.go
@@ -151,13 +151,24 @@ func (s *stackAllocState) stackalloc() {
// Allocate args to their assigned locations.
for _, v := range f.Entry.Values {
- if v.Op != OpArg {
+ if v.Op != OpArg { // && v.Op != OpArgFReg && v.Op != OpArgIReg {
continue
}
if v.Aux == nil {
f.Fatalf("%s has nil Aux\n", v.LongString())
}
- loc := LocalSlot{N: v.Aux.(*ir.Name), Type: v.Type, Off: v.AuxInt}
+ var loc LocalSlot
+ var name *ir.Name
+ var offset int64
+ if v.Op == OpArg {
+ name = v.Aux.(*ir.Name)
+ offset = v.AuxInt
+ } else {
+ nameOff := v.Aux.(*AuxNameOffset)
+ name = nameOff.Name
+ offset = nameOff.Offset
+ }
+ loc = LocalSlot{N: name, Type: v.Type, Off: offset}
if f.pass.debug > stackDebug {
fmt.Printf("stackalloc %s to %s\n", v, loc)
}