diff options
author | Tom Tromey <tromey@redhat.com> | 2001-12-21 05:28:27 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-12-21 05:28:27 +0000 |
commit | 84a944b3cae32d3034bfe3360114464383419a36 (patch) | |
tree | 1a6248da57443147f39004ede5f9ef11ca3d7cde /gcc/java/parse.y | |
parent | 2d93b92445219f257ccb6bee1c132f28677275fe (diff) | |
download | gcc-84a944b3cae32d3034bfe3360114464383419a36.zip gcc-84a944b3cae32d3034bfe3360114464383419a36.tar.gz gcc-84a944b3cae32d3034bfe3360114464383419a36.tar.bz2 |
For PR java/4509:
* parse.y (java_complete_lhs) [COMPOUND_EXPR]: Correctly compute
CAN_COMPLETE_NORMALLY for the node.
* jcf-write.c (generate_bytecode_insns) [COMPOUND_EXPR]: Don't
generate code for second branch if first branch can't complete
normally.
(generate_bytecode_insns) [LOOP_EXPR]: Don't generate `goto' to
the loop head if the loop body can't complete normally.
From-SVN: r48233
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r-- | gcc/java/parse.y | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y index aeec759..7c50c97 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -11776,8 +11776,12 @@ java_complete_lhs (node) TREE_OPERAND (node, 1) = java_complete_tree (TREE_OPERAND (node, 1)); if (TREE_OPERAND (node, 1) == error_mark_node) return error_mark_node; + /* Even though we might allow the case where the first + operand doesn't return normally, we still should compute + CAN_COMPLETE_NORMALLY correctly. */ CAN_COMPLETE_NORMALLY (node) - = CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 1)); + = (CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 0)) + && CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 1))); } TREE_TYPE (node) = TREE_TYPE (TREE_OPERAND (node, 1)); break; |