[ecj] Patch: FYI: fix ordering bugs, others

Andrew Haley aph@redhat.com
Fri Dec 7 13:18:00 GMT 2007


Tom Tromey writes:
 > I'm checking this in on the gcj-eclipse branch.
 > 
 > This patch is a bit messy since it is conceptually a few different
 > fixes in one.  I forgot how they interact, though, and there didn't
 > seem to be much reason to try to separate them all out again.
 > 
 > * PR 27643, a bug involving the order in which we read class files.
 >   This is fixed by moving around the java_mark_class_local logic.
 >   Note that this breaks .java compilation; I didn't look into this
 >   because...
 > * This patch removes the ability to compile .java files.
 > * This patch fixes is_compiled_class to return the correct results.
 >   Right now it is sometimes wrong, e.g. it assumes that any file
 >   coming from a .zip must be compiled into this object.

I'd like to back-port the fix for PR 27643 to older branches.  In what
way does it break .java compilation?  It looks to mek like the change
you made only affects .class files.

Andrew.


 > Index: jcf-io.c
 > ===================================================================
 > --- jcf-io.c	(revision 114362)
 > +++ jcf-io.c	(working copy)
 > @@ -1,5 +1,5 @@
 >  /* Utility routines for finding and reading Java(TM) .class files.
 > -   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005
 > +   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006
 >     Free Software Foundation, Inc.
 >  
 >  This file is part of GCC.
 > @@ -450,6 +450,9 @@
 >    char *buffer;
 >    hashval_t hash;
 >  
 > +  /* FIXME: ecj hack.  */
 > @@ -857,8 +860,6 @@
 >  
 >    gen_indirect_dispatch_tables (current_class);
 >  
 > -  java_mark_class_local (current_class);
 > -
 >    for (method = TYPE_METHODS (current_class);
 >         method != NULL_TREE; method = TREE_CHAIN (method))
 >      {
 > @@ -1293,8 +1299,15 @@
 >        parse_source_file_3 ();
 >      }
 >  
 > +  /* Do this before lowering any code.  */
 >    for (node = current_file_list; node; node = TREE_CHAIN (node))
 >      {
 > +      if (CLASS_FILE_P (node))
 > +	java_mark_class_local (TREE_TYPE (node));
 > +    }
 > +
 > +  for (node = current_file_list; node; node = TREE_CHAIN (node))
 > +    {
 >        input_location = DECL_SOURCE_LOCATION (node);
 >        if (CLASS_FILE_P (node))
 >  	{

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903



More information about the Gcc-patches mailing list