Bug 18362 - [4.0/4.1 Regression] internal compiler error: in size_binop, at fold-const.c:1598
Summary: [4.0/4.1 Regression] internal compiler error: in size_binop, at fold-const.c:...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.4.2
: P2 normal
Target Milestone: 4.0.0
Assignee: Andrew Haley
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-11-07 19:06 UTC by Bojan Antonovic
Modified: 2005-07-23 22:49 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
testcase (5.39 KB, application/x-java-archive)
2005-02-18 16:48 UTC, Daniel Bonniot
Details
patch (555 bytes, patch)
2005-02-23 15:07 UTC, Andrew Haley
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bojan Antonovic 2004-11-07 19:06:08 UTC
The page

http://java.sun.com/developer/earlyAccess/adding_generics/

has a zip file adding_generics-2_4-ea.zip, which containts gjc-rt.jar. Compiling
it by

1) gcj --main=com.sun.tools.javac.Main gjc-rt.jar
2) gcj --main=com.sun.tools.javac.Main com/sun/tools/*/*.class

gives the internal compiler error in both cases.
Comment 1 Andrew Pinski 2004-11-07 20:33:46 UTC
On the mainline we get:
com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java: In class 
'com.sun.tools.doclets.internal.toolkit.util.VisibleMemberMap$ClassMembers':
com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java: In method 
'com.sun.tools.doclets.internal.toolkit.util.VisibleMemberMap$ClassMembers.getClassMembers(com.su
n.javadoc.ClassDoc,boolean)':
com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java:337: error: verification error at 
PC=207
com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java:337: error: invalid argument type
com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java:337: error: expected type 
'com.sun.javadoc.ProgramElementDoc[]' but stack contains 'java.lang.Object[]'
java/util/LinkedList.java: In class 'com.sun.tools.doclets.internal.toolkit.builders.LayoutParser':
java/util/LinkedList.java: In method 
'com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML(java.lang.String)':
java/util/LinkedList.java:64: error: cannot find file for class javax.xml.parsers.SAXParserFactory
java/util/LinkedList.java:64: error: cannot find file for class javax.xml.parsers.SAXParserFactory
java/util/LinkedList.java:64: error: cannot find file for class javax.xml.parsers.SAXParser
java/util/LinkedList.java:72: error: cannot find file for class javax.xml.parsers.SAXParserFactory
java/util/LinkedList.java:72: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 2 Bojan Antonovic 2004-11-08 00:11:31 UTC
Subject: Re:  internal compiler error: in size_binop, at fold-const.c:1598

I receive (with GCC 3.4.2, compiled with GCC 3.4.1, on Mac OS 10.3.5):

for 1) :
com/sun/tools/javac/code/Source.java: In class 
`com.sun.tools.javac.code.Source':
com/sun/tools/javac/code/Source.java: In method 
`com.sun.tools.javac.code.Source.instance(com.sun.tools.javac.util.Context)':
com/sun/tools/javac/code/Source.java:51: internal compiler error: in 
size_binop, at fold-const.c:1598
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

for 2) :
/var/tmp//ccrpzlx6.s:117:FATAL:Symbol 
__ZN3com3sun5tools7javadoc20JavadocClassReader$14makeEv already defined.
/var/tmp//ccrpzlx6.s:116:FATAL:Symbol 
__ZN3com3sun5tools7javadoc14JavadocEnter$14makeEv already defined.
/var/tmp//ccrpzlx6.s:116:FATAL:Symbol 
__ZN3com3sun5tools7javadoc20JavadocMemberEnter$14makeEv already defined.
/var/tmp//ccrpzlx6.s:116:FATAL:Symbol 
__ZN3com3sun5tools7javadoc13JavadocTodo$14makeEv already defined.
/var/tmp//ccrpzlx6.s:147:FATAL:Symbol 
__ZN3com3sun5tools7javadoc10Messager$14makeEv already defined.
/var/tmp//ccrpzlx6.s:213:FATAL:Symbol 
__ZN3com3sun5tools7javadoc10Messager$24makeEv already defined.
com/sun/tools/javadoc/Start.java: In class `com.sun.tools.javadoc.Start':
com/sun/tools/javadoc/Start.java: In method 
`com.sun.tools.javadoc.Start.parseAndExecute(java.lang.String[])':
com/sun/tools/javadoc/Start.java:195: internal compiler error: in 
size_binop, at fold-const.c:1598
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

My configuration can be seen at: 
http://gcc.gnu.org/ml/gcc/2004-09/msg00677.html

Bytheway, I saw GCC 3.4.3 came out. I have to recheck my 2 bugreports 
against 3.4.3. Tomorrow will be a compilation day! :)

Comment 3 Bojan Antonovic 2004-11-08 16:18:16 UTC
Subject: Re:  internal compiler error: in size_binop, at fold-const.c:1598

Problems exists still with GCC 3.4.3.

for 1) like with GCJ 3.4.2

for 2) very similar

/var/tmp//ccl50gLh.s:117:FATAL:Symbol 
__ZN3com3sun5tools7javadoc20JavadocClassReader$14makeEv already defined.
/var/tmp//ccl50gLh.s:116:FATAL:Symbol 
__ZN3com3sun5tools7javadoc14JavadocEnter$14makeEv already defined.
/var/tmp//ccl50gLh.s:116:FATAL:Symbol 
__ZN3com3sun5tools7javadoc20JavadocMemberEnter$14makeEv already defined.
/var/tmp//ccl50gLh.s:116:FATAL:Symbol 
__ZN3com3sun5tools7javadoc13JavadocTodo$14makeEv already defined.
/var/tmp//ccl50gLh.s:147:FATAL:Symbol 
__ZN3com3sun5tools7javadoc10Messager$14makeEv already defined.
/var/tmp//ccl50gLh.s:213:FATAL:Symbol 
__ZN3com3sun5tools7javadoc10Messager$24makeEv already defined.
com/sun/tools/javadoc/Start.java: In class `com.sun.tools.javadoc.Start':
com/sun/tools/javadoc/Start.java: In method 
`com.sun.tools.javadoc.Start.parseAndExecute(java.lang.String[])':
com/sun/tools/javadoc/Start.java:195: internal compiler error: in 
size_binop, at fold-const.c:1598
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Bojan

Comment 4 Daniel Bonniot 2005-02-18 16:48:27 UTC
Created attachment 8228 [details]
testcase

This is a 6K jar that exhibits the same behaviour:

$ /usr/lib/gcc-snapshot/bin/gcj --indirect-dispatch N.jar
bossa/syntax/ast.nice:0: internal compiler error: in size_binop, at
fold-const.c:1637

That's with gcj 4.0.0 20050212.

Note that if you remove any of the three classes from the jar, the bug does not
occur. Neither does it if you unpack the jar and call gcj on the three classes
directly.
Comment 5 Andrew Haley 2005-02-23 15:07:43 UTC
Created attachment 8264 [details]
patch

Try this patch
Comment 6 Daniel Bonniot 2005-02-23 17:10:36 UTC
Patch works for me on the small testcase (N.jar). I'll try on the whole jar when
I get the chance.
Comment 7 Daniel Bonniot 2005-02-23 17:40:06 UTC
I tried the patched gcj on the whole jar (containing the Nice compiler), and
this error does not occur (nor any other, yay!).

As far as I can tell, Andrew's patch fixes this bug.
Comment 8 GCC Commits 2005-03-04 15:32:58 UTC
Subject: Bug 18362

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	aph@gcc.gnu.org	2005-03-04 15:32:44

Modified files:
	gcc/java       : ChangeLog class.c 

Log message:
	2005-03-04  Andrew Haley  <aph@redhat.com>
	
	PR java/18362
	* class.c (set_method_index): Don't set method_index if it is
	NULL_TREE.
	(layout_class_method): Don't complain about "non-static method foo
	overrides static method" in the case of indirect dispatch.

Patches:
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&r2=1.1556.2.1
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&r2=1.220.8.1

Comment 9 GCC Commits 2005-03-04 15:38:23 UTC
Subject: Bug 18362

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	aph@gcc.gnu.org	2005-03-04 15:38:14

Modified files:
	gcc/java       : ChangeLog class.c 

Log message:
	2005-03-04  Andrew Haley  <aph@redhat.com>
	
	PR java/18362
	* class.c (set_method_index): Don't set method_index if it is
	NULL_TREE.
	(layout_class_method): Don't complain about "non-static method foo
	overrides static method" in the case of indirect dispatch.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1560&r2=1.1561
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/class.c.diff?cvsroot=gcc&r1=1.220&r2=1.221

Comment 10 Daniel Bonniot 2005-03-05 21:02:53 UTC
Verified. The patch works for me. 

(I can't really set to verified since I'm not the original submitter)
Comment 11 Andrew Pinski 2005-03-05 21:04:45 UTC
Fixed.