Bug 16658

Summary: errors compiling saxon xslt library
Product: gcc Reporter: Joe Barnett <jbarnett>
Component: javaAssignee: Not yet assigned to anyone <unassigned>
Severity: normal CC: gcc-bugs, java-prs
Priority: P2    
Version: 3.4.1   
Target Milestone: 4.3.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2004-09-09 16:38:14
Bug Depends on: 28067    
Bug Blocks:    
Attachments: minimal source set to reproduce

Description Joe Barnett 2004-07-21 17:26:11 UTC
I'm trying to use gcj to compile the saxon xslt java library (version 6.5.3)
from source.

gcj -v reports:

Reading specs from /opt/cross/i386/lib/gcc/i686-tw-linux-gnu/3.4.1/specs
Reading specs from
rename spec lib to liborig
Configured with: /home/jcpage/depot/mp/tools/gcc-3.4.1/configure
--target=i686-tw-linux-gnu --host=i686-pc-linux-gnu --prefix=/opt/cross/i386
--enable-languages=c,c++,java --disable-nls --enable-shared
--enable-threads=posix --enable-c99 --enable-long-long
Thread model: posix
gcc version 3.4.1

The first error I run into is in the com.icl.saxon.om package (it actually
happens with all files in the package, but I'll only include commands and output
for AbstractNode.java-the first source file):
with a cwd of src/com/icl/saxon/om, I try to run:
gcj -Wno-deprecated -I./../../../../ -Ixml-apis/src -c AbstractNode.java -o

and get the following error:
./AbstractNode.java:33: error: Class `com.icl.saxon.om.AbstractNode' already
defined in AbstractNode.java:33.
   public abstract class AbstractNode implements Node, NodeInfo, SourceLocator,
DOMLocator {
./AbstractNode.java:154: confused by earlier errors, bailing out

I can work around that error by running the following command with a CWD of src/:

gcj -Wno-deprecated -Ixml-apis/src -c com/icl/saxon/om/AbstractNode.java -o

After working around this for all files in the om package: I get the following
error in the com.icl.saxon.tree package:

When compiling ElementImpl.java:
gcj -Wno-deprecated -I./../../../../ -Ixml-apis/src -c ElementImpl.java -o

ElementImpl.java: In class `com.icl.saxon.tree.ElementImpl':
ElementImpl.java: In method `com.icl.saxon.tree.ElementImpl.setNameCode(int)':
ElementImpl.java:48: internal compiler error: in expand_expr_real, at expr.c:7090
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

all other files in the package build succesfully.  

running gcj with -save-temps only appears to generate .s files, so I will
refrain from attaching any files unless specifically asked to.  

the saxon source I am using is available from
http://prdownloads.sourceforge.net/saxon/saxon6_5_3.zip in the source.zip
archive inside of the saxon6_5_3 archive.  
The xml-apis source that needs to be included in the classpath is available from
http://apache.mirrors.versehost.com/xml/commons/xml-commons-1.0.b2.tar.gz in the
xml-commons-1.0.b2/java/external/src/ subdirectory of the archive.
Comment 1 Joe Barnett 2004-07-21 17:57:27 UTC
Clarification: for the AbstractNode.java problem, it's not actually all the
classes in the com.icl.saxon.om package that fail, just the ones that implement
the "Node, NodeInfo, SourceLocator, DOMLocator" interfaces.

The common class definition that fails is:

public abstract class XXX implements Node, NodeInfo, SourceLocator, DOMLocator {

files that succeed either do not inherit or implement classes, or are classes
taht extend Exception, or interfaces that exetend NodeInfo
Comment 2 Joe Barnett 2004-07-22 17:01:29 UTC
Created attachment 6800 [details]
minimal source set to reproduce

attached is a pruned source tree of saxon and xml-apis:


gcj com/icl/saxon/tree/ElementImpl.java 

will reproduce the bug.
Comment 3 Joe Barnett 2004-09-08 21:50:04 UTC
is there additional information needed to allow you guys to debug this properly?
Comment 4 Tom Tromey 2004-09-08 22:45:06 UTC
With CVS head I don't see a crash, but I do see:

./javax/xml/transform/TransformerFactory.java:133: error: Nested class
javax.xml.parsers.FactoryFinder$ConfigurationError is non-public; cannot be
accessed from here.
           } catch (FactoryFinder.ConfigurationError e) {

This appears to be correct, though.
FactoryFinder.ConfigurationError is package-private.
It is not accessible outside javax.xml.parsers
Comment 5 Joe Barnett 2004-09-08 23:28:28 UTC
Interesting....  but since javax/xml/transform/TransformerFactory.java doesn't
import javax.xml.parsers.FactoryFinder, FactoryFinder.ConfigurationError should
resolve to javax.xml.transform.FactoryFinder.ConfigurationError, which is
protected, but still accessible from javax.xml.transform.TransformerFactory.  

Hmm...  looking through the tarball I attached it seems that I left out
javax/xml/transform/FactoryFinder.java.  should I attach a new tarball, or just
the javax/xml/transform/FactoryFinder.java file?  I suppose I should get gcc
from CVS head and see how far I can get with it, since the crash seems to be
fixed.  Will try that and report results when I get a chance.
Comment 6 Tom Tromey 2004-09-08 23:57:19 UTC
Please attach the file.
Perhaps gcj will crash when this file is included.
Comment 7 Joe Barnett 2004-09-09 00:01:58 UTC
Created attachment 7072 [details]

Comment 8 Tom Tromey 2004-09-09 14:48:14 UTC
With the new file, I do get an ICE.
Thanks for uploading it.
Comment 9 Joe Barnett 2004-10-15 17:16:22 UTC
any luck trying to narrow down the fix for this?
Comment 10 Tom Tromey 2007-01-09 20:46:17 UTC
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.