diff options
author | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 2000-01-07 12:28:11 -0800 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 2000-01-07 12:28:11 -0800 |
commit | 6b924cc558a46d79df85bcb7bb60228c07612314 (patch) | |
tree | 597c2f89bfcc3461548b776d8a0ec9cdcf15cd4f /gcc/java/jcf-write.c | |
parent | bd3a924b10709d4ab1ad61717bcc31ceb4c23fb4 (diff) | |
download | gcc-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/jcf-write.c')
-rw-r--r-- | gcc/java/jcf-write.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index 8c39c61..98436f2 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -1160,7 +1160,8 @@ generate_bytecode_conditional (exp, true_label, false_label, } break; 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); break; case TRUTH_ANDIF_EXPR: @@ -1238,7 +1239,7 @@ generate_bytecode_conditional (exp, true_label, false_label, } 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); op = op + (OPCODE_ifnull - OPCODE_if_acmpeq); negop = (op & 1) ? op - 1 : op + 1; @@ -1622,6 +1623,10 @@ generate_bytecode_insns (exp, target, state) define_jcf_label (else_label, state); generate_bytecode_insns (TREE_OPERAND (exp, 2), target, 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; case CASE_EXPR: |