From: Bryce McKinlay <bryce@waitaki.otago.ac.nz>
To: Per Bothner <per@bothner.com>
Cc: Nic Ferrier <nferrier@tapsellferrier.co.uk>,
java@gcc.gnu.org, java-patches@gcc.gnu.org,
gcc-patches@gcc.gnu.org
Subject: Java patch: Re: gcj producing bad code
Date: Sun, 07 Apr 2002 14:31:00 -0000 [thread overview]
Message-ID: <3CAFBDF9.1010904@waitaki.otago.ac.nz> (raw)
In-Reply-To: <3CAF8956.6040309@bothner.com>
[-- Attachment #1: Type: text/plain, Size: 647 bytes --]
Per Bothner wrote:
> I suspect the problem is that the variable 'from_super' isn't
> being reset in resolve_qualified_expression_name. Alex?
Right. resolve_qualified_expression_name iterates through each element
in a WFL, setting the from_super flag if it sees a "super.". But in the
case of a "super" qualified method call it forgets to clear the flag
before it is done, so in the case of:
super.getX().getY()
the getY() is treated as if it were a "super" call also, and is emitted
as a non-virtual call when it should not be.
The patch below fixes the problem. I'm testing it now. OK to commit
assuming no problems?
regards
Bryce.
[-- Attachment #2: java-fromsuper.patch --]
[-- Type: text/plain, Size: 675 bytes --]
2002-04-07 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* parse.y (resolve_qualified_expression_name): Clear "from_super" flag
after using it to patch CALL_EXPR.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.370
diff -u -r1.370 parse.y
--- parse.y 1 Apr 2002 08:46:07 -0000 1.370
+++ parse.y 7 Apr 2002 03:08:24 -0000
@@ -9462,6 +9462,7 @@
*where_found = patch_method_invocation (qual_wfl, decl, type,
from_super,
&is_static, &ret_decl);
+ from_super = 0;
if (*where_found == error_mark_node)
{
RESTORE_THIS_AND_CURRENT_CLASS;
next prev parent reply other threads:[~2002-04-07 3:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-05 15:29 Nic Ferrier
2002-04-05 18:51 ` Bryce McKinlay
2002-04-06 7:55 ` Nic Ferrier
2002-04-06 8:22 ` Eric Blake
2002-04-06 15:47 ` Nic Ferrier
2002-04-06 17:39 ` Per Bothner
2002-04-06 19:34 ` Bryce McKinlay
2002-04-07 14:31 ` Bryce McKinlay [this message]
2002-04-08 2:04 ` Java patch: " Alexandre Petit-Bianco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3CAFBDF9.1010904@waitaki.otago.ac.nz \
--to=bryce@waitaki.otago.ac.nz \
--cc=gcc-patches@gcc.gnu.org \
--cc=java-patches@gcc.gnu.org \
--cc=java@gcc.gnu.org \
--cc=nferrier@tapsellferrier.co.uk \
--cc=per@bothner.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).