aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-08-28 17:55:10 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-08-28 17:55:10 +0000
commit06657dcd6ecd5778db641ef2db6abec43145b697 (patch)
treeb68800dc2dae71a196953452e6bdf4c98f5a47f5
parent68350f4f0f05e12b9fe74cd339f1654e4703d418 (diff)
downloadgcc-06657dcd6ecd5778db641ef2db6abec43145b697.zip
gcc-06657dcd6ecd5778db641ef2db6abec43145b697.tar.gz
gcc-06657dcd6ecd5778db641ef2db6abec43145b697.tar.bz2
jcf-write.c (generate_bytecode_insns): Generate an integer to real conversion for increments and decrements of reals.
* jcf-write.c (generate_bytecode_insns): Generate an integer to real conversion for increments and decrements of reals. From-SVN: r45230
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/jcf-write.c11
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index a54af0d..60d7527 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-28 Mark Mitchell <mark@codesourcery.com>
+
+ * jcf-write.c (generate_bytecode_insns): Generate an integer to
+ real conversion for increments and decrements of reals.
+
2001-08-24 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (check_deprecation): Handle TYPE_DECL in a special case,
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 7339e95..383cc6a 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -1960,8 +1960,15 @@ generate_bytecode_insns (exp, target, state)
/* Stack, if ARRAY_REF: ..., [result, ] array, index, oldvalue. */
/* Stack, if COMPONENT_REF: ..., [result, ] objectref, oldvalue. */
/* Stack, otherwise: ..., [result, ] oldvalue. */
- if (size == 1)
- push_int_const (value, state);
+ if (size == 1 || TREE_CODE (type) == REAL_TYPE)
+ {
+ push_int_const (value, state);
+ if (TREE_CODE (type) == REAL_TYPE)
+ {
+ RESERVE (1);
+ OP1 (TYPE_PRECISION (type) == 32 ? OPCODE_i2f : OPCODE_i2d);
+ }
+ }
else
push_long_const (value, (HOST_WIDE_INT)(value >= 0 ? 0 : -1), state);
NOTE_PUSH (size);