aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-11-22 21:49:06 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-11-22 21:49:06 +0000
commitdd06be9e8d59e0678a74c1591a1f62376ba8a02d (patch)
treea47fac3261485517342a2cd77a5f799068289c8c /gcc/java
parent34744d4e5f096a4e50a089bbed764de091d8ca07 (diff)
downloadgcc-dd06be9e8d59e0678a74c1591a1f62376ba8a02d.zip
gcc-dd06be9e8d59e0678a74c1591a1f62376ba8a02d.tar.gz
gcc-dd06be9e8d59e0678a74c1591a1f62376ba8a02d.tar.bz2
re PR java/8676 (ICE in generate_bytecode_conditional at jcf-write.c:1359)
* parse.y (patch_binop): Cast right hand side of shift expression to `int'. Fixes PR java/8676. From-SVN: r59390
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/parse.y5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 0a2f1dc..9dd2e1e 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-22 Tom Tromey <tromey@redhat.com>
+
+ * parse.y (patch_binop): Cast right hand side of shift expression
+ to `int'. Fixes PR java/8676.
+
2002-11-22 Ranjit Mathew <rmathew@hotmail.com>
Andrew Haley <aph@redhat.com>
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 2a77235..21b2235 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -13465,6 +13465,11 @@ patch_binop (node, wfl_op1, wfl_op2)
op1 = do_unary_numeric_promotion (op1);
op2 = do_unary_numeric_promotion (op2);
+ /* If the right hand side is of type `long', first cast it to
+ `int'. */
+ if (TREE_TYPE (op2) == long_type_node)
+ op2 = build1 (CONVERT_EXPR, int_type_node, op2);
+
/* The type of the shift expression is the type of the promoted
type of the left-hand operand */
prom_type = TREE_TYPE (op1);