From: Keith Randall Date: Tue, 3 Nov 2015 17:30:17 +0000 (-0800) Subject: [dev.ssa] cmd/compile: Handle ONOT in conditionals as well X-Git-Tag: go1.7beta1~1623^2^2~111 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d19bfc3b681029da32c1ac661b27764a532aa0fc;p=gostls13.git [dev.ssa] cmd/compile: Handle ONOT in conditionals as well Might as well, for a && !(b && c) and the like. Change-Id: I2548b6e6ee5870e074bcef6edd56a7db6e81d70f Reviewed-on: https://go-review.googlesource.com/16600 Reviewed-by: David Chase Run-TryBot: David Chase --- diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 2c935b7247..90abd8e05d 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -2026,6 +2026,11 @@ func (s *state) condBranch(cond *Node, yes, no *ssa.Block, likely int8) { // If likely==1, then we don't have enough info to decide // the likelihood of the first branch. } + if cond.Op == ONOT { + s.stmtList(cond.Ninit) + s.condBranch(cond.Left, no, yes, -likely) + return + } c := s.expr(cond) b := s.endBlock() b.Kind = ssa.BlockIf