From ed737fd8cdc1a668027bb5f5dac8879afabcca3b Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 24 Feb 2016 10:29:27 -0800 Subject: [dev.ssa] cmd/compile: fix @ rewrite rules The @ directive used to read the target block after some value structure had already changed. I don't think it was ever really a bug, but it's confusing. It might fail like this: (Foo x y) -> @v.Args[0].Block (Bar y (Baz ...)) v.Op = Bar v.Args[0] = y v.Args[1] = v.Args[0].Block.NewValue(Baz, ...) That new value is allocated in the block of y, not the block of x. Anyway, read the destination block first so this potential bug can't happen. Change-Id: Ie41d2fc349b35cefaa319fa9327808bcb781b4e2 Reviewed-on: https://go-review.googlesource.com/19900 Run-TryBot: Todd Neal TryBot-Result: Gobot Gobot Reviewed-by: Todd Neal --- src/cmd/compile/internal/ssa/TODO | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/cmd/compile/internal/ssa/TODO') diff --git a/src/cmd/compile/internal/ssa/TODO b/src/cmd/compile/internal/ssa/TODO index 91983476a2..69356d6226 100644 --- a/src/cmd/compile/internal/ssa/TODO +++ b/src/cmd/compile/internal/ssa/TODO @@ -7,8 +7,6 @@ Coverage Correctness ----------- - Debugging info (check & fix as much as we can) -- @ directive in rewrites might read overwritten data. Save @loc - in variable before modifying v. Optimizations (better compiled code) ------------------------------------ -- cgit v1.2.1