$ gcj -C myBug.java myBug.java: In class `myBug': myBug.java: In method `myBug.bug()': myBug.java:5: Internal compiler error in generate_bytecode_insns, at java/jcf-write.c:1974 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. Release: 3.2.1 Environment: Linux 2.4.20. Tested on AMD K6 and Athlon How-To-Repeat: public class myBug { final static int myConst = 200; public static void bug() { myConst++; /* ICE */ } }
still fails on the mainline (20030525): gcj -C myBug.java myBug.java: In class `myBug': myBug.java: In method `myBug.bug()': myBug.java:6: internal compiler error: in generate_bytecode_insns, at java/jcf- write.c:1900 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. (gdb) bt #0 0x4202bb8a in exit () from /lib/i686/libc.so.6 #1 0x0811487a in diagnostic_action_after_output (context=0x4212dc80, diagnostic= 0x83) at /home/gates/pinskia/src/gnu/gcc/src/gcc/diagnostic.c:963 #2 0x08114c6c in diagnostic_report_diagnostic (context=0x8454ac0, diagnostic= 0xbffebf60) at /home/gates/pinskia/src/gnu/gcc/src/gcc/diagnostic.c:1102 #3 0x08115111 in internal_error (msgid=0x83 <Address 0x83 out of bounds>) at /home/ gates/pinskia/src/gnu/gcc/src/gcc/diagnostic.c:1311 #4 0x081155df in fancy_abort (file=0x83 <Address 0x83 out of bounds>, line= 1108532352, function=0x83 <Address 0x83 out of bounds>) at /home/gates/pinskia/src/ gnu/gcc/src/gcc/diagnostic.c:1458 #5 0x080cccae in generate_bytecode_insns (exp=0x4005d898, target=2, state= 0xbffec340) at /home/gates/pinskia/src/gnu/gcc/src/gcc/java/jcf-write.c:1900 #6 0x080c9211 in generate_bytecode_insns (exp=0x4004c4e0, target=2, state= 0xbffec340) at /home/gates/pinskia/src/gnu/gcc/src/gcc/java/jcf-write.c:1436 #7 0x080c8609 in generate_bytecode_insns (exp=0x400ad268, target=2, state= 0xbffec340) at /home/gates/pinskia/src/gnu/gcc/src/gcc/java/jcf-write.c:1406 #8 0x080cef99 in generate_classfile (clas=0x40077af8, state=0xbffec340) at /home/ gates/pinskia/src/gnu/gcc/src/gcc/java/jcf-write.c:2972 #9 0x080d075e in write_classfile (clas=0x40077af8) at /home/gates/pinskia/src/gnu/gcc/ src/gcc/java/jcf-write.c:3381 #10 0x0806ad1f in java_expand_classes () at parse.y:9020 #11 0x080be552 in java_parse_file (set_yydebug=0) at /home/gates/pinskia/src/gnu/gcc/ src/gcc/java/jcf-parse.c:1119 #12 0x0830096a in compile_file () at /home/gates/pinskia/src/gnu/gcc/src/gcc/ toplev.c:2209 #13 0x08306528 in do_compile () at /home/gates/pinskia/src/gnu/gcc/src/gcc/ toplev.c:5581 #14 0x08306599 in toplev_main (argc=131, argv=0x0) at /home/gates/pinskia/src/gnu/ gcc/src/gcc/toplev.c:5612 #15 0x080d9a2b in main (argc=131, argv=0x83) at /home/gates/pinskia/src/gnu/gcc/src/ gcc/main.c:37 (gdb) p debug_tree(exp) <integer_cst 0x4005d898 type <integer_type 0x40050360 int> constant tree_0 200>
still ICEs on the mainline (20030711).
Note this fails both on the bytecode generator and the native code generator (at least on powerpc-apple-darwin7.0.0, 20031018).
Now it ICEs when gimplification happens: gimplification failed: 200 <integer_cst 0x400c7288 type <integer_type 0x4004f414 int> constant invariant tree_0 200> myBug.java: In class `myBug': myBug.java: In method `myBug.bug()': myBug.java:6: internal compiler error: in gimplify_expr, at gimplify.c:3576 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
*** Bug 25664 has been marked as a duplicate of this bug. ***
test case from http://bugs.debian.org/351512 class gcjbug { public static void main (String [] p) { System.out.println(1++); } }
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
I've posted a patch for the test case given in comment #6 here: http://gcc.gnu.org/ml/gcc-patches/2006-07/msg01142.html
Subject: Bug 8923 Author: aph Date: Thu Aug 10 19:35:07 2006 New Revision: 116069 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116069 Log: 2006-08-10 Simon Martin <simartin@users.sourceforge.net> PR java/8923 * parse.y (build_incdec): Emit an error instead of an ICE if '++' or '--' is used with a constant operand. (java_complete_lhs): When processing a '++' or '--' expression, don't call java_complete_tree but java_complete_lhs, so that a static final variable operand is never replaced by its value. This avoids an ICE later on. (patch_unaryop): Fixed typo in comment. Modified: trunk/gcc/java/ChangeLog trunk/gcc/java/parse.y
Fixed on the mainline.
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.