From 38b03d4045019f2a5d7d3566f7daaa52383f768d Mon Sep 17 00:00:00 2001 From: tromey Date: Tue, 12 Sep 2006 19:51:08 +0000 Subject: [PATCH] * expr.c (push_value): Always flush quick stack. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116905 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/ChangeLog | 4 ++++ gcc/java/expr.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index af1c42b12e4..756fbcf7e42 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,5 +1,9 @@ 2006-09-12 Tom Tromey + * expr.c (push_value): Always flush quick stack. + +2006-09-12 Tom Tromey + PR java/29013: * jcf-write.c (generate_bytecode_insns) : Always note the push of the called method's return result. diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 26cd7da5078..3cb3db7bb2c 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -301,6 +301,13 @@ push_value (tree value) TREE_CHAIN (node) = quick_stack; quick_stack = node; } + /* If the value has a side effect, then we need to evaluate it + whether or not the result is used. If the value ends up on the + quick stack and is then popped, this won't happen -- so we flush + the quick stack. It is safest to simply always flush, though, + since TREE_SIDE_EFFECTS doesn't capture COMPONENT_REF, and for + the latter we may need to strip conversions. */ + flush_quick_stack (); } /* Pop a type from the type stack. -- 2.11.4.GIT