This is the mail archive of the java-prs@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

java/8958: Unreachable statement causes gcj to exit:


>Number:         8958
>Category:       java
>Synopsis:       Unreachable statement causes gcj to exit:
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 16 03:26:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Dhek Bhun Kho
>Release:        gcj-3.2.1
>Organization:
>Environment:
(don't ask me why ada is included, I never use it)
Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java --host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)
 /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2/jc1 /tmp/cc0Hpv2fjx -quiet -dumpbase cc0Hpv2fjx -g1 -version -foutput-class-dir=cls -fclasspath=/home/java/jar/java_cup.jar:/home/java/jar/org.apache.bcel.jar:src/ -ffilelist-file -fsyntax-only -femit-class-files -o /dev/null
GNU Java version 3.2 (Mandrake Linux 9.0 3.2-1mdk) (i586-mandrake-linux-gnu)
	compiled by GNU C version 3.2 (Mandrake Linux 9.0 3.2-1mdk).
Class path starts here:
    /home/java/jar/java_cup.jar/ (zip)
    /home/java/jar/org.apache.bcel.jar/ (zip)
    src/
    /usr/share/java/libgcj-3.2.jar/ (system) (zip)
>Description:
possible related to 8828 3846

offender:

public int m(int a, int b) {

for (b = methodA(b)+1; ; current++)
{
  int i = methodB(b);
  if (i == -1) 
  {
     return -1;
  } else {
     return methodC(b);
  }
}

there is probably some flag to turn this behavior off, but it's not the default behavior of the sun javac. I don't really care, people shouldn't write dead code. but it's a bug. a warning should have been enough I guess.
>How-To-Repeat:
compile it with standard flags.
>Fix:
remove the incrementer from the for loop.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]