summaryrefslogtreecommitdiff
path: root/gcc/java/jcf-write.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-28 17:55:10 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-28 17:55:10 +0000
commit6889ed9db19a0273f56d4458e787855a59875a7d (patch)
treeb68800dc2dae71a196953452e6bdf4c98f5a47f5 /gcc/java/jcf-write.c
parent38e15fae75e09350885c55a2ef45c7d15f1a503d (diff)
downloadgcc-6889ed9db19a0273f56d4458e787855a59875a7d.tar.gz
* jcf-write.c (generate_bytecode_insns): Generate an integer to
real conversion for increments and decrements of reals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45230 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/jcf-write.c')
-rw-r--r--gcc/java/jcf-write.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 7339e95315b..383cc6a7c7a 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);