From 1cde1d05336de7fe0c1f1eac6c32dfe7dc582856 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 17 Apr 2002 16:36:47 +0000 Subject: [PATCH] jcf-write.c (generate_bytecode_insns): Only write const_0 if not negative zero. * jcf-write.c (generate_bytecode_insns): Only write const_0 if not negative zero. From-SVN: r52427 --- gcc/java/ChangeLog | 5 +++++ gcc/java/jcf-write.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index ecc8e50b43d..2666603aabf 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2002-04-16 Mark Wielaard + + * jcf-write.c (generate_bytecode_insns): Only write const_0 if not + negative zero. + 2002-04-16 Bryce McKinlay Fix for PR java/6294: diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index f357e63d9cd..215d0c56c17 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -25,6 +25,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "system.h" #include "jcf.h" #include "tree.h" +#include "real.h" #include "java-tree.h" #include "obstack.h" #undef AND @@ -1536,7 +1537,7 @@ generate_bytecode_insns (exp, target, state) { int prec = TYPE_PRECISION (type) >> 5; RESERVE(1); - if (real_zerop (exp)) + if (real_zerop (exp) && ! REAL_VALUE_MINUS_ZERO (TREE_REAL_CST (exp))) OP1 (prec == 1 ? OPCODE_fconst_0 : OPCODE_dconst_0); else if (real_onep (exp)) OP1 (prec == 1 ? OPCODE_fconst_1 : OPCODE_dconst_1);