aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/compile-i386.c
diff options
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-03 18:39:59 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:02:35 -0700
commit50e1e8adb088f43098db18034775d212bfb91d94 (patch)
tree9fd198fc7e3af8331d8b46634cd18899ac73143a /compile-i386.c
parent50f15c801dba75e58b383b43c8d661adfa61db49 (diff)
downloadsparse-dev-50e1e8adb088f43098db18034775d212bfb91d94.tar.gz
Make "emit_conditional_test()" use register caches.
Diffstat (limited to 'compile-i386.c')
-rw-r--r--compile-i386.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/compile-i386.c b/compile-i386.c
index f51231e3..453febd0 100644
--- a/compile-i386.c
+++ b/compile-i386.c
@@ -1415,14 +1415,17 @@ static struct storage *emit_binop(struct expression *expr)
static int emit_conditional_test(struct storage *val)
{
+ struct storage *reg;
struct storage *target_val;
int target_false;
/* load result into EAX */
- insn("movl", val, REG_EAX, "begin if/conditional");
+ emit_comment("begin if/conditional");
+ reg = get_reg_value(val);
/* compare result with zero */
- insn("test", REG_EAX, REG_EAX, NULL);
+ insn("test", reg, reg, NULL);
+ put_reg(reg);
/* create conditional-failed label to jump to */
target_false = new_label();