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
parent bd3a924b
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.
1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* class.c (assume_compiled, assume_compiled_node): Add static * class.c (assume_compiled, assume_compiled_node): Add static
...@@ -48,12 +57,6 @@ ...@@ -48,12 +57,6 @@
patch_throw_statement, check_thrown_exceptions, patch_throw_statement, check_thrown_exceptions,
patch_conditional_expr): Likewise. patch_conditional_expr): Likewise.
1999-12-17 Tom Tromey <tromey@cygnus.com>
* gjavah.c (decode_signature_piece): Print "::" in JArray<>. This
fixes PR gcj/119.
(process_file): Use `\n\' at end of each line in string.
Fri Dec 24 00:25:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> Fri Dec 24 00:25:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* Makefile.in (LIBDEPS): Added gcc's errors.o * Makefile.in (LIBDEPS): Added gcc's errors.o
...@@ -87,6 +90,12 @@ Fri Dec 24 00:25:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> ...@@ -87,6 +90,12 @@ Fri Dec 24 00:25:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
and lookup class candidate. and lookup class candidate.
(java_pre_expand_clinit): Removed unnecessary local variable. (java_pre_expand_clinit): Removed unnecessary local variable.
1999-12-17 Tom Tromey <tromey@cygnus.com>
* gjavah.c (decode_signature_piece): Print "::" in JArray<>. This
fixes PR gcj/119.
(process_file): Use `\n\' at end of each line in string.
Thu Dec 16 00:09:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> Thu Dec 16 00:09:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* expr.c (expand_invoke): Layout the loaded class before * expr.c (expand_invoke): Layout the loaded class before
......
...@@ -1160,7 +1160,8 @@ generate_bytecode_conditional (exp, true_label, false_label, ...@@ -1160,7 +1160,8 @@ generate_bytecode_conditional (exp, true_label, false_label,
} }
break; break;
case TRUTH_NOT_EXPR: case TRUTH_NOT_EXPR:
generate_bytecode_conditional (TREE_OPERAND (exp, 0), false_label, true_label, generate_bytecode_conditional (TREE_OPERAND (exp, 0),
false_label, true_label,
! true_branch_first, state); ! true_branch_first, state);
break; break;
case TRUTH_ANDIF_EXPR: case TRUTH_ANDIF_EXPR:
...@@ -1238,7 +1239,7 @@ generate_bytecode_conditional (exp, true_label, false_label, ...@@ -1238,7 +1239,7 @@ generate_bytecode_conditional (exp, true_label, false_label,
} }
if (integer_zerop (exp1) || integer_zerop (exp0)) if (integer_zerop (exp1) || integer_zerop (exp0))
{ {
generate_bytecode_insns (integer_zerop (exp1) ? exp0 : exp0, generate_bytecode_insns (integer_zerop (exp1) ? exp0 : exp1,
STACK_TARGET, state); STACK_TARGET, state);
op = op + (OPCODE_ifnull - OPCODE_if_acmpeq); op = op + (OPCODE_ifnull - OPCODE_if_acmpeq);
negop = (op & 1) ? op - 1 : op + 1; negop = (op & 1) ? op - 1 : op + 1;
...@@ -1622,6 +1623,10 @@ generate_bytecode_insns (exp, target, state) ...@@ -1622,6 +1623,10 @@ generate_bytecode_insns (exp, target, state)
define_jcf_label (else_label, state); define_jcf_label (else_label, state);
generate_bytecode_insns (TREE_OPERAND (exp, 2), target, state); generate_bytecode_insns (TREE_OPERAND (exp, 2), target, state);
define_jcf_label (end_label, state); define_jcf_label (end_label, state);
/* COND_EXPR can be used in a binop. The stack must be adjusted. */
if (TREE_TYPE (exp) != void_type_node)
NOTE_POP (TYPE_PRECISION (TREE_TYPE (exp)) > 32 ? 2 : 1);
} }
break; break;
case CASE_EXPR: case CASE_EXPR:
......
...@@ -9850,13 +9850,11 @@ patch_binop (node, wfl_op1, wfl_op2) ...@@ -9850,13 +9850,11 @@ patch_binop (node, wfl_op1, wfl_op2)
type of the left-hand operand */ type of the left-hand operand */
prom_type = TREE_TYPE (op1); prom_type = TREE_TYPE (op1);
/* Shift int only up to 0x1f and long up to 0x3f */ /* Shift int only up to 0x1f and long up to 0x3f. The bytecode
if (prom_type == int_type_node) generator should take care of removing this operation. FIXME */
op2 = fold (build (BIT_AND_EXPR, int_type_node, op2, op2 = fold (build (BIT_AND_EXPR, prom_type, convert (prom_type, op2),
build_int_2 (0x1f, 0))); (prom_type == int_type_node ? build_int_2 (0x1f, 0) :
else convert (prom_type, build_int_2 (0x3f, 0)))));
op2 = fold (build (BIT_AND_EXPR, int_type_node, op2,
build_int_2 (0x3f, 0)));
/* The >>> operator is a >> operating on unsigned quantities */ /* The >>> operator is a >> operating on unsigned quantities */
if (code == URSHIFT_EXPR && ! flag_emit_class_files) if (code == URSHIFT_EXPR && ! flag_emit_class_files)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment