]> Cypherpunks repositories - gostls13.git/commit
gc: fix order of evaluation
authorRuss Cox <rsc@golang.org>
Wed, 25 Jan 2012 22:53:50 +0000 (17:53 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 25 Jan 2012 22:53:50 +0000 (17:53 -0500)
commitee9bfb023a0cda29ee97eeec592d34c504e9705c
treec8d8a9d086008865adae76568ab1ab188c1d0c1e
parent73ce14d0aa693f84e86dd61b3d3e862bcd4979d3
gc: fix order of evaluation

Pulling function calls out to happen before the
expression being evaluated was causing illegal
reorderings even without inlining; with inlining
it got worse.  This CL adds a separate ordering pass
to move things with a fixed order out of expressions
and into the statement sequence, where they will
not be reordered by walk.

Replaces lvd's CL 5534079.

Fixes #2740.

R=lvd
CC=golang-dev
https://golang.org/cl/5569062
14 files changed:
src/cmd/gc/Makefile
src/cmd/gc/fmt.c
src/cmd/gc/gen.c
src/cmd/gc/go.h
src/cmd/gc/inl.c
src/cmd/gc/order.c [new file with mode: 0644]
src/cmd/gc/pgen.c
src/cmd/gc/sinit.c
src/cmd/gc/subr.c
src/cmd/gc/typecheck.c
src/cmd/gc/walk.c
test/fixedbugs/bug401.go
test/func8.go [new file with mode: 0644]
test/reorder2.go [new file with mode: 0644]