Fix expression type for floating point negation ('!')
commitc0296d71405a97349d82e9909cad82a2af3271c2
authorXi Wang <xi.wang@gmail.com>
Fri, 24 May 2013 13:30:36 +0000 (24 09:30 -0400)
committerPekka Enberg <penberg@kernel.org>
Mon, 27 May 2013 11:15:56 +0000 (27 14:15 +0300)
treef84eb92742f2603b26251b334ef70df8c869d293
parent99bdda1a38a6e3622cb72f422b2fb05045c29df7
Fix expression type for floating point negation ('!')

Run test-linearize against this program.

static int foo(float x) { return !x; }

The output is:

set.32      %r2 <- 0.000000
bad_op.32
ret.32      %r3

The expression type of zero testing should be EXPR_COMPARE, rather than
EXPR_BINOP, which causes bad_op.

Acked-by: Christopher Li <sparse@chrisli.org>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
evaluate.c