diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-22 21:49:06 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-22 21:49:06 +0000 |
commit | 2900719d7723017a3945e32af1c9802c67d2cfcc (patch) | |
tree | a47fac3261485517342a2cd77a5f799068289c8c | |
parent | 6cdfd7de7741015946963c2a933f683eed48b6cd (diff) | |
download | ppe42-gcc-2900719d7723017a3945e32af1c9802c67d2cfcc.tar.gz ppe42-gcc-2900719d7723017a3945e32af1c9802c67d2cfcc.zip |
* parse.y (patch_binop): Cast right hand side of shift expression
to `int'. Fixes PR java/8676.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59390 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/parse.y | 5 |
2 files changed, 10 insertions, 0 deletions
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 <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 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); |