Description of problem: When parens are omitted in the following expression: String s = "abc" + (i instanceof Integer); a segmentation fault occurs. The type of i does not appear to matter, i.e. a seg. fault occurs for several different types declared for 'i' (Tried: String, Integer, int) Version-Release number of selected component (if applicable): gcj -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/libgcj.spec rename spec lib to liborig Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) How reproducible: The following seg faults: public class Bug2 { public static void main (String args[]) { int i; String s = "abc" + i instanceof Integer; } } Steps to Reproduce: 1. Enter above into a file called 'Bug2.java' 2. javac Bug2.java 3. Actual results: javac Bug2.java Bug2.java: In class `Bug2': Bug2.java: In method `Bug2.main(java.lang.String[])': Bug2.java:4: internal error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Expected results: 'instanceof' should have lower precedence than '+' so the expression should be interpreted as ("abc" + i) instanceof Integer, which would result in a boolean. Since a boolean cannot be assigned to a String, the parser should have issued an error message. Additional info: This was actually run in RedHat 9.0
So why are you reporting it against FC2, where it certainly works? gcj --main=Bug2 -o /tmp/Bug2 /tmp/Bug2.java /tmp/Bug2.java: In class `Bug2': /tmp/Bug2.java: In method `Bug2.main(java.lang.String[])': /tmp/Bug2.java:4: error: Impossible for `java.lang.String' to be instance of `java.lang.Integer'. String s = "abc" + i instanceof Integer; ^ 1 error RHL9 is EOL, so don't expect any fixes there (well, for security fixes you can be looking at the Fedora Legacy project, but for this kind of things chances getting it fixed are close to zero unless you find some volunteer).
Many apologies ... I just downloaded gcc3.4 and found this to be fixed.