diff options
author | Bryce McKinlay <mckinlay@redhat.com> | 2004-05-31 14:54:37 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2004-05-31 15:54:37 +0100 |
commit | 1aae9cdcf2517fb75451442eb9e93f77db09cd7a (patch) | |
tree | 3cb93076533bb4a350d8633ae40722c3ce1e735c | |
parent | b47785f4ab321d38c5a25eb2c469c940f73801f8 (diff) | |
download | gcc-1aae9cdcf2517fb75451442eb9e93f77db09cd7a.zip gcc-1aae9cdcf2517fb75451442eb9e93f77db09cd7a.tar.gz gcc-1aae9cdcf2517fb75451442eb9e93f77db09cd7a.tar.bz2 |
jcf-write.c (generate_bytecode_conditional): Correct handling of unordered conditionals.
* jcf-write.c (generate_bytecode_conditional): Correct handling
of unordered conditionals. Add comment.
From-SVN: r82485
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/jcf-write.c | 11 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 05d61d1..0b1585a 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2004-05-31 Bryce McKinlay <mckinlay@redhat.com> + + * jcf-write.c (generate_bytecode_conditional): Correct handling + of unordered conditionals. Add comment. + 2004-05-29 Ranjit Mathew <rmathew@hotmail.com> Per Bothner <per@bothner.com> diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index 5aa6d5a..b04d559 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -1179,25 +1179,25 @@ generate_bytecode_conditional (tree exp, op = OPCODE_if_icmpne; goto compare; - case UNLT_EXPR: + case UNLE_EXPR: unordered = 1; case GT_EXPR: op = OPCODE_if_icmpgt; goto compare; - case UNGT_EXPR: + case UNGE_EXPR: unordered = 1; case LT_EXPR: op = OPCODE_if_icmplt; goto compare; - case UNLE_EXPR: + case UNLT_EXPR: unordered = 1; case GE_EXPR: op = OPCODE_if_icmpge; goto compare; - case UNGE_EXPR: + case UNGT_EXPR: unordered = 1; case LE_EXPR: op = OPCODE_if_icmple; @@ -1206,6 +1206,9 @@ generate_bytecode_conditional (tree exp, compare: if (unordered) { + /* UNLT_EXPR(a, b) means 'a < b || unordered(a, b)'. This is + the same as the Java source expression '!(a >= b)', so handle + it that way. */ struct jcf_block *tmp = true_label; true_label = false_label; false_label = tmp; |