public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: FYI: merge flush-quick-stack patch
@ 2006-09-12 19:51 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2006-09-12 19:51 UTC (permalink / raw)
  To: Java Patch List; +Cc: Gcc Patch List

I'm checking this in on the trunk.

This merges over a fix that has been on the ecj branch for a while.

Recently the eclipse compiler has started generating bytecode like:

 13: checkcast #17=<Class CD>
 16: pop

In this situation we still have to emit an explicit _Jv_CheckCast
call.  This patch ensures that by always flushing the quick stack.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* expr.c (push_value): Always flush quick stack.

Index: expr.c
===================================================================
--- expr.c	(revision 116902)
+++ expr.c	(working copy)
@@ -301,6 +301,13 @@
       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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-12 19:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-12 19:51 Patch: FYI: merge flush-quick-stack patch Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).