aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/jcf-write.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 64e12fe..d8310a0 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-01 Roger Sayle <roger@eyesopen.com>
+
+ * jcf-write.c (generate_bytecode_insns): Implement RSHIFT_EXPR
+ of unsigned types using iushr and lushr JVM bytecodes.
+
2005-02-02 Ranjit Mathew <rmathew@hotmail.com>
PR java/19738
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index da8c6c9..603eaa5 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2146,7 +2146,9 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
jopcode = OPCODE_irem;
goto binop;
case LSHIFT_EXPR: jopcode = OPCODE_ishl; goto binop;
- case RSHIFT_EXPR: jopcode = OPCODE_ishr; goto binop;
+ case RSHIFT_EXPR:
+ jopcode = TYPE_UNSIGNED (type) ? OPCODE_iushr : OPCODE_ishr;
+ goto binop;
case URSHIFT_EXPR: jopcode = OPCODE_iushr; goto binop;
case TRUTH_AND_EXPR:
case BIT_AND_EXPR: jopcode = OPCODE_iand; goto binop;