Bug 27439

Summary: gcj chokes on invalid expression
Product: gcc Reporter: Dennis Brakhane <brakhane>
Component: javaAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, java-prs
Priority: P3    
Version: 4.0.2   
Target Milestone: 4.3.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2006-05-05 07:11:56
Bug Depends on: 8923, 28067    
Bug Blocks:    

Description Dennis Brakhane 2006-05-04 22:35:19 UTC
The following short (invalid) sourcecode:
---
class Foo {
    public void bar() {
	int x = 42;
	++-x;
    }
}
---
crashes gcj 4.0.2:
$ gcj -v -save-temps Bug.java
Using built-in specs.
Reading specs from /usr/lib/gcc/i486-linux-gnu/4.0.4/../../../libgcj.spec
rename spec lib to liborig
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --with-tune=i686 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.4 20060422 (prerelease) (Debian 4.0.3-2)
 /usr/lib/gcc/i486-linux-gnu/4.0.4/jc1 Bug.java -fhash-synchronization -fno-use-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -fno-omit-frame-pointer -fkeep-inline-functions -quiet -dumpbase Bug.java -mtune=i686 -auxbase Bug -g1 -version -o Bug.s
GNU Java version 4.0.4 20060422 (prerelease) (Debian 4.0.3-2) (i486-linux-gnu)
        compiled by GNU C version 4.0.4 20060422 (prerelease) (Debian 4.0.3-2).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32055
Class path starts here:
    ./
    /usr/share/java/libgcj-4.0.4.jar/ (system) (zip)
Bug.java: In class 'Foo':
Bug.java: In method 'Foo.bar()':
Bug.java:4: internal compiler error: in gimplify_expr, at gimplify.c:4378
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>.

When compiling to bytecode, the error becomes:
internal compiler error: in generate_bytecode_insns, at java/jcf-write.c:1960
Comment 1 Andrew Pinski 2006-05-05 07:11:56 UTC
Confirmed, related to PR 8923.
Comment 2 Tom Tromey 2007-01-09 20:48:36 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.
Thanks.