java/4510: Compiler seg fault on '(String) ((long) d + "d")'

jsperri@gmx.net jsperri@gmx.net
Tue Oct 9 00:26:00 GMT 2001


>Number:         4510
>Category:       java
>Synopsis:       Compiler seg fault on '(String) ((long) d + "d")'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 09 00:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     jsperri@gmx.net
>Release:        gcc-3.0.1
>Organization:
>Environment:
gcc version 3.0.1 - Thread model: posix
built with ../gcc-3.0.1/configure --enable-threads=posix
on Linux Mandrake 8.0-x86


>Description:
The attached piece of code generates a segfault when compiled with gcj 3.0.1. Compiler flags used:
gcj -v --main=HelloWorld HelloWorld.java --classpath=/usr
/local/share/libgcj.jar -o Hello

Compiler output:
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../../libgc
j.spec
rename spec lib to liborig
rename spec startfile to startfileorig
Configured with: ../gcc-3.0.1/configure --enable-threads=posix
Thread model: posix
gcc version 3.0.1
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/jc1 HelloWorld.java -fuse-divide
-subroutine -fuse-boehm-gc -fnon-call-exceptions -quiet -dumpbase HelloWorld.jav
a -g1 -version -fclasspath=/usr/local/share/libgcj.jar -o /tmp/ccI7ZYnk.s
GNU Java version 3.0.1 (i686-pc-linux-gnu)
        compiled by GNU C version 3.0.1.
HelloWorld.java: In class `HelloWorld':
HelloWorld.java: In method `HelloWorld.main(java.lang.String[])':
HelloWorld.java:6: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
>How-To-Repeat:
Just compile HelloWorld class.

GCJ should core with:
HelloWorld.java: In class `HelloWorld':
HelloWorld.java: In method `HelloWorld.main(java.lang.String[])':
HelloWorld.java:6: Internal error: Segmentation fault

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="HelloWorld.java"
Content-Disposition: inline; filename="HelloWorld.java"

public class HelloWorld {

    public static void main (String []args)
    {
	double d=1.0;
	System.out.println ((String) ((long) d + "d"));
    }
}



More information about the Gcc-bugs mailing list