From: Tom Tromey Date: Fri, 22 Nov 2002 21:49:06 +0000 (+0000) Subject: re PR java/8676 (ICE in generate_bytecode_conditional at jcf-write.c:1359) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd06be9e8d59e0678a74c1591a1f62376ba8a02d;p=gcc.git 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 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 0a2f1dc447b..9dd2e1e1f06 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2002-11-22 Tom Tromey + + * parse.y (patch_binop): Cast right hand side of shift expression + to `int'. Fixes PR java/8676. + 2002-11-22 Ranjit Mathew Andrew Haley diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 2a77235f3b1..21b2235589b 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);