]> Cypherpunks repositories - gostls13.git/commit
6g,8g: make constant propagation inlining-friendly.
authorJamie Gennis <jgennis@google.com>
Wed, 8 Feb 2012 15:25:13 +0000 (10:25 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 8 Feb 2012 15:25:13 +0000 (10:25 -0500)
commitfff732ea2c4d3cb449c4383a6957ff80ca75c70a
treec0a2015f4c4b1a5f42688f05cea2afde77b8df92
parent1460cce0813e1336102e73e8403ed5845744eac1
6g,8g: make constant propagation inlining-friendly.

This changes makes constant propagation compare 'from' values using node
pointers rather than symbol names when checking to see whether a set
operation is redundant. When a function is inlined multiple times in a
calling function its arguments will share symbol names even though the values
are different. Prior to this fix the bug409 test would hit a case with 6g
where an LEAQ instruction was incorrectly eliminated from the second inlined
function call. 8g appears to have had the same bug, but the test did not fail
there.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5646044
src/cmd/6g/peep.c
src/cmd/8g/peep.c
test/fixedbugs/bug409.go [new file with mode: 0644]
test/fixedbugs/bug409.out [new file with mode: 0644]