public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/21436] New: imports not remembered for previously compiled files
@ 2005-05-07  7:14 bonzini at gcc dot gnu dot org
  2005-05-07  9:23 ` [Bug java/21436] " bonzini at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-05-07  7:14 UTC (permalink / raw)
  To: java-prs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/21436] imports not remembered for previously compiled files
  2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
@ 2005-05-07  9:23 ` bonzini at gcc dot gnu dot org
  2005-05-07 10:58 ` bonzini at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-05-07  9:23 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From bonzini at gcc dot gnu dot org  2005-05-07 09:22 -------
With this version of AWTEvent.java, this is an ice-on-valid:

   package java.awt;
   import java.util.EventObject;
   public abstract class AWTEvent extends EventObject {
       AWTEvent() { super(null); }
   }

I have prepared a patch which is now under testing, and it is really a "how 
could it have worked" situation.  When creating ctxp_for_generation we add at 
the head of the list, so passes 2 and 3 are invoked in LIFO order.  By the time 
we try to resolve AWTEvent in B.java, java_complete_class (pass 2) has not been 
done on AWTEvent yet.  It seems obvious to me that passes 2 and 3 should be 
executed in FIFO order.

In addition, find_in_imports should look at ctxp->import_list even if enclosing 
is not NULL, if enclosing's TYPE_IMPORT_LIST is NULL (likewise for 
find_in_on_demand_imports).

Patch under testing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |bonzini at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-07 09:22:59
               date|                            |


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/21436] imports not remembered for previously compiled files
  2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
  2005-05-07  9:23 ` [Bug java/21436] " bonzini at gcc dot gnu dot org
@ 2005-05-07 10:58 ` bonzini at gcc dot gnu dot org
  2005-05-09 10:03 ` bonzini at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-05-07 10:58 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |21442
              nThis|                            |


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/21436] imports not remembered for previously compiled files
  2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
  2005-05-07  9:23 ` [Bug java/21436] " bonzini at gcc dot gnu dot org
  2005-05-07 10:58 ` 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
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-05-09 10:03 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From bonzini at gcc dot gnu dot org  2005-05-09 10:03 -------
*** Bug 21442 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|21442                       |
              nThis|                            |


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/21436] imports not remembered for previously compiled files
  2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-10 13:24 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-05-10 13:24 -------
Subject: Bug 21436

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bonzini@gcc.gnu.org	2005-05-10 13:23:40

Modified files:
	libjava        : ChangeLog 
	libjava/testsuite/libjava.jacks: jacks.xfail 
	gcc/java       : ChangeLog class.c parse.h parse.y 

Log message:
	gcc/java:
	2005-05-10  Paolo Bonzini  <bonzini@gnu.org>
	
	PR java/21436
	* class.c (maybe_layout_super_class): Look for imports in this_class.
	* parse.h (ctxp_for_generation_last): New.
	(do_resolve_class): Add a parameter.
	* parse.y (ctxp_for_generation_last): New.
	(java_pop_parser_context): Add at end of list.
	(find_in_imports, find_in_imports_on_demand): Look in ctxp
	if the TYPE_IMPORT_LIST or respectively the TYPE_IMPORT_DEMAND_LIST of
	the given type are NULL.
	(do_resolve_class): Look into the imports of the new second parameter.
	Adjust recursive calls.
	(resolve_class, resolve_inner_class, find_as_inner_class): Adjust
	calls to do_resolve_class.
	(create_class): Set the TYPE_IMPORT_LIST and TYPE_IMPORT_DEMAND_LIST.
	(java_complete_class): Do not do that here.
	
	libjava:
	2005-05-10  Paolo Bonzini  <bonzini@gnu.org>
	
	PR java/21436
	* testsuite/libjava.jacks/jacks.xfail: Adjust.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3603&r2=1.3604
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.jacks/jacks.xfail.diff?cvsroot=gcc&r1=1.21&r2=1.22
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1607&r2=1.1608
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/class.c.diff?cvsroot=gcc&r1=1.225&r2=1.226
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.h.diff?cvsroot=gcc&r1=1.105&r2=1.106
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.532&r2=1.533



-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/21436] imports not remembered for previously compiled files
  2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-05-10 13:55 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From bonzini at gcc dot gnu dot org  2005-05-10 13:55 -------
Patch committed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/21436] imports not remembered for previously compiled files
  2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  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:57 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-05  7:46 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.0


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/21436] imports not remembered for previously compiled files
  2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-06-05  7:46 ` pinskia at gcc dot gnu dot org
@ 2005-08-17 12:57 ` cvs-commit at gcc dot gnu dot org
  2005-08-17 12:58 ` bonzini at gcc dot gnu dot org
  2005-08-17 14:57 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-08-17 12:57 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-08-17 12:57 -------
Subject: Bug 21436

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	bonzini@gcc.gnu.org	2005-08-17 12:57:08

Modified files:
	libjava        : ChangeLog Makefile.am Makefile.in configure 
	                 configure.ac 
	libjava/external: Makefile.in 
	libjava/external/sax: Makefile.in 
	libjava/external/w3c_dom: Makefile.in 
	libjava/gcj    : Makefile.in 
	libjava/include: Makefile.in 
	libjava/testsuite: Makefile.in 
	libjava/testsuite/libjava.jacks: jacks.xfail 
	gcc/java       : ChangeLog class.c parse.h parse.y 

Log message:
	libjava:
	2005-08-17  Paolo Bonzini  <bonzini@gnu.org>
	
	Backport from mainline:
	
	2005-05-18  Paolo Bonzini  <bonzini@gnu.org>
	
	* Makefile.am (Makefile.deps): Do not use \0, it is unportable.
	* Makefile.in: Regenerate.
	
	2005-05-17  Paolo Bonzini  <bonzini@gnu.org>
	
	* configure.ac (--enable-libgcj-multifile): Remove.
	
	* Makefile.am (all_native_compiled_source_files,
	(all_native_compiled_dirs, all_java_dirs, all_java_lo_files,
	all_libgcj_lo_files, all_xlib_lo_files,
	all_java_deps_files, all_java_stamp_files,
	all_java_filelist_files): New variables.
	(EXTRA_DIST): New Automake variable.
	(CLEANFILES): Add .stamp, .list and .lo files.
	(%.list, %.lo, %.stamp, Makefile.deps): New rules.
	(classes.stamp): Depend on $(all_java_stamp_files).
	(libgcj.la): Pass $(libgcj_la_LIBADD) to the linker without
	going through write_entries_to_file.
	
	(all_java_source_files, all_property_files): Move earlier.
	(libgcj_la_OBJECTS, javao_files, xlib_javao_files,
	all_java_class_files): Remove.
	(gtk_awt_peer_sources): Rename to...
	(gtk_awt_peer_source_files): ... this.  Adjust throughout.
	
	(ONESTEP): Remove.
	(libgcj0_convenience_la_SOURCES): Remove Java source files.
	(libgcj0_convenience_la_LIBADD): Add $(all_libgcj_lo_files).
	(libgcj0_convenience_la_DEPENDENCIES): Likewise.
	(libgcj_la_SOURCES): Remove.
	(lib_gnu_awt_xlib_la_SOURCES): Remove Java source files.
	(lib_gnu_awt_xlib_la_LIBADD): Add $(all_xlib_lo_files).
	(lib_gnu_awt_xlib_la_DEPENDENCIES): Likewise.
	
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* external/Makefile.in: Regenerate.
	* external/sax/Makefile.in: Regenerate.
	* external/w3c_dom/Makefile.in: Regenerate.
	* gcj/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libltdl/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	
	2005-05-10  Paolo Bonzini  <bonzini@gnu.org>
	
	PR java/21436
	* testsuite/libjava.jacks/jacks.xfail: Adjust.
	
	gcc/java:
	2005-08-17  Paolo Bonzini  <bonzini@gnu.org>
	
	Backport from mainline:
	
	2005-05-19  Paolo Bonzini  <bonzini@gnu.org>
	
	PR java/17845
	
	* parse.y (register_package, package_list): Remove.
	(package_declaration): Do not call register_package.
	(do_resolve_class): Do not use package_list.
	
	2005-05-10  Paolo Bonzini  <bonzini@gnu.org>
	
	PR java/21436
	* class.c (maybe_layout_super_class): Look for imports in this_class.
	* parse.h (ctxp_for_generation_last): New.
	(do_resolve_class): Add a parameter.
	* parse.y (ctxp_for_generation_last): New.
	(java_pop_parser_context): Add at end of list.
	(find_in_imports, find_in_imports_on_demand): Look in ctxp
	if the TYPE_IMPORT_LIST or respectively the TYPE_IMPORT_DEMAND_LIST of
	the given type are NULL.
	(do_resolve_class): Look into the imports of the new second parameter.
	Adjust recursive calls.
	(resolve_class, resolve_inner_class, find_as_inner_class): Adjust
	calls to do_resolve_class.
	(create_class): Set the TYPE_IMPORT_LIST and TYPE_IMPORT_DEMAND_LIST.
	(java_complete_class): Do not do that here.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3391.2.89&r2=1.3391.2.90
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/Makefile.am.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.455.2.13&r2=1.455.2.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.485.2.13&r2=1.485.2.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/configure.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.253.2.4&r2=1.253.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/configure.ac.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.19.2.4&r2=1.19.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/external/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1.14.2&r2=1.1.14.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/external/sax/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.2.12.2&r2=1.2.12.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/external/w3c_dom/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.2.12.2&r2=1.2.12.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gcj/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.62.10.2&r2=1.62.10.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/include/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.64.4.2&r2=1.64.4.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.73.10.2&r2=1.73.10.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.jacks/jacks.xfail.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.19&r2=1.19.8.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1556.2.27&r2=1.1556.2.28
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/class.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.220.8.3&r2=1.220.8.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.103&r2=1.103.18.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.528.6.2&r2=1.528.6.3



-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/21436] imports not remembered for previously compiled files
  2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-08-17 12:57 ` cvs-commit at gcc dot gnu dot org
@ 2005-08-17 12:58 ` bonzini at gcc dot gnu dot org
  2005-08-17 14:57 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-08-17 12:58 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From bonzini at gcc dot gnu dot org  2005-08-17 12:58 -------
Fix committed to 4.0 branch as part of fixing PR20155

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.0.2 4.1.0


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/21436] imports not remembered for previously compiled files
  2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2005-08-17 12:58 ` bonzini at gcc dot gnu dot org
@ 2005-08-17 14:57 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-17 14:57 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.0                       |4.0.2


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-08-17 14:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-07  7:14 [Bug java/21436] New: imports not remembered for previously compiled files bonzini at gcc dot gnu dot org
2005-05-07  9:23 ` [Bug java/21436] " bonzini at gcc dot gnu dot org
2005-05-07 10:58 ` 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:57 ` cvs-commit at gcc dot gnu dot org
2005-08-17 12:58 ` bonzini at gcc dot gnu dot org
2005-08-17 14:57 ` pinskia at gcc dot gnu dot org

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).