From 2af06480140dd48a4dc54257c2da46a73ca3ebb5 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 11 Aug 2015 14:23:08 -0700 Subject: [PATCH] [dev.ssa] cmd/compile: fix function call memory accounting We were not recording function calls as changing the state of memory. As a result, the scheduler was not aware that storing values to the stack in order to make a function call must happen *after* retrieving results from the stack from a just-completed function call. This fixes the container/ring tests. This was my first experience debugging an issue using the HTML output. I'm feeling quite pleased with it. Change-Id: I9e8276846be9fd7a60422911b11816c5175e3d0a Reviewed-on: https://go-review.googlesource.com/13560 Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/ssa.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 13a6d6c009..dcc7de8d04 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -1319,6 +1319,7 @@ func (s *state) expr(n *Node) *ssa.Value { // read result from stack at the start of the fallthrough block s.startBlock(bNext) + s.vars[&memvar] = call var titer Iter fp := Structfirst(&titer, Getoutarg(left.Type)) if fp == nil {