aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-01-07 12:28:11 -0800
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-01-07 12:28:11 -0800
commit6b924cc558a46d79df85bcb7bb60228c07612314 (patch)
tree597c2f89bfcc3461548b776d8a0ec9cdcf15cd4f /gcc/java/parse.y
parentbd3a924b10709d4ab1ad61717bcc31ceb4c23fb4 (diff)
downloadgcc-6b924cc558a46d79df85bcb7bb60228c07612314.zip
gcc-6b924cc558a46d79df85bcb7bb60228c07612314.tar.gz
gcc-6b924cc558a46d79df85bcb7bb60228c07612314.tar.bz2
re GNATS gcj/122 (SP mismatch error from certain code constructs)
Thu Jan 6 00:54:10 2000 Alexandre Petit-Bianco <apbianco@cygnus.com> * jcf-write.c (generate_byecode_conditional): Fixed indentation in method invocation and typo in conditional expression. (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue the appropriate NOTE_POP. * parse.y (patch_binop): Shift value mask to feature the right type. (This is a fix for the PR #122: http://sourceware.cygnus.com/ml/java-prs/2000-q1/msg00000.html) From-SVN: r31277
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 2b2afe3..6784d27 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -9850,13 +9850,11 @@ patch_binop (node, wfl_op1, wfl_op2)
type of the left-hand operand */
prom_type = TREE_TYPE (op1);
- /* Shift int only up to 0x1f and long up to 0x3f */
- if (prom_type == int_type_node)
- op2 = fold (build (BIT_AND_EXPR, int_type_node, op2,
- build_int_2 (0x1f, 0)));
- else
- op2 = fold (build (BIT_AND_EXPR, int_type_node, op2,
- build_int_2 (0x3f, 0)));
+ /* Shift int only up to 0x1f and long up to 0x3f. The bytecode
+ generator should take care of removing this operation. FIXME */
+ op2 = fold (build (BIT_AND_EXPR, prom_type, convert (prom_type, op2),
+ (prom_type == int_type_node ? build_int_2 (0x1f, 0) :
+ convert (prom_type, build_int_2 (0x3f, 0)))));
/* The >>> operator is a >> operating on unsigned quantities */
if (code == URSHIFT_EXPR && ! flag_emit_class_files)