public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bonzini at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug java/21436] New: imports not remembered for previously compiled files
Date: Sat, 07 May 2005 07:14:00 -0000	[thread overview]
Message-ID: <20050507071353.21436.bonzini@gcc.gnu.org> (raw)

With a patch to compile libjava on a per-directory basis, I found a bug with imports

Take file AWTEvent.java

   package java.awt;
   import java.util.EventObject;
   public abstract class AWTEvent extends EventObject {}

and file B.java

   package java.awt;
   import java.awt.event.ComponentEvent;
   public class B {
     Object[] o = ComponentEvent.class.getFields();
   }

When processing ComponentEvent in B.java, it finds AWTEvent (the superclass of
ComponentEvent) but it cannot resolve the EventObject class there.  That's
because java_complete_class was not called yet for AWTEvent, and its
TYPE_IMPORTS_LIST is not set yet.

If I move the setting of TYPE_IMPORS_LIST to create_class, then in
maybe_layout_super_class another bug is hit and the TYPE_IMPORTS_LIST of
AWTEvent is not used to resolve the EventObject class.  I have a patch to fix
all this but I have not tested it yet, and it does not allow anyway to finish
bootstrap with per-directory builds.  I suspect a (theoretically) simpler fix is
to call java_complete_class earlier (at least once per file), but I am not sure
about what java_complete_class is doing at all.

Paolo

-- 
           Summary: imports not remembered for previously compiled files
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bonzini at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21436


             reply	other threads:[~2005-05-07  7:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-07  7:14 bonzini at gcc dot gnu dot org [this message]
2005-05-07  9:23 ` [Bug java/21436] " bonzini at gcc dot gnu dot org
2005-05-07 10:59 ` bonzini at gcc dot gnu dot org
2005-05-09 10:03 ` bonzini at gcc dot gnu dot org
2005-05-10 13:24 ` cvs-commit at gcc dot gnu dot org
2005-05-10 13:55 ` bonzini at gcc dot gnu dot org
2005-06-05  7:46 ` pinskia at gcc dot gnu dot org
2005-08-17 12:58 ` cvs-commit at gcc dot gnu dot org
2005-08-17 13:06 ` bonzini at gcc dot gnu dot org
2005-08-17 14:58 ` pinskia at gcc dot gnu dot org

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=20050507071353.21436.bonzini@gcc.gnu.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).