diff options
Diffstat (limited to 'gcc/java/jcf-write.c')
-rw-r--r-- | gcc/java/jcf-write.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index febd04f..82c77b1 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -1462,8 +1462,9 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) OP1 (prec == 1 ? OPCODE_fconst_0 : OPCODE_dconst_0); else if (real_onep (exp)) OP1 (prec == 1 ? OPCODE_fconst_1 : OPCODE_dconst_1); - /* FIXME Should also use fconst_2 for 2.0f. - Also, should use iconst_2/ldc followed by i2f/i2d + else if (prec == 1 && real_twop (exp)) + OP1 (OPCODE_fconst_2); + /* ??? We could also use iconst_3/ldc followed by i2f/i2d for other float/double when the value is a small integer. */ else { |