Bug 21519 - ICE in generate_bytecode_conditional, at java/jcf-write.c:1337
Summary: ICE in generate_bytecode_conditional, at java/jcf-write.c:1337
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.0.1
: P2 normal
Target Milestone: 4.0.1
Assignee: Tom Tromey
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-05-11 21:00 UTC by Pawel Sikora
Modified: 2005-05-15 19:13 UTC (History)
2 users (show)

See Also:
Host: i686-pld-linux
Target: i686-pld-linux
Build: i686-pld-linux
Known to work:
Known to fail:
Last reconfirmed: 2005-05-13 20:01:59


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2005-05-11 21:00:39 UTC
# gcc-4.0.1-20050507 
 
during build (gcj -C -O2 for all *.java) of the org.eclipse.jdt.core 
from eclipse 3.1M6 tarball I get: 
  
org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java:210: 
 
internal compiler error: in generate_bytecode_conditional,  
at java/jcf-write.c:1337  
  
# testcase: 
 
unpack eclipse-sourceBuild-srcIncluded-3.1M6.zip and run below script: 
 
cd plugins/org.eclipse.jdt.core 
 
cp -f   model/org/eclipse/jdt/core/Signature.java \ 
        compiler/org/eclipse/jdt/core 
 
for f in `find batch -name '*.java' -or -name '*.properties'`; do 
    g=`echo $f | sed 's:^batch/:compiler/:' | xargs dirname` 
    [ -d $g ] || mkdir -p $g 
    cp -a $f $g 
done 
 
cd compiler 
for f in `find -name '*.java' | cut -c 3-`; do 
    gcj -Wno-deprecated -C -O2 $f 
done
Comment 1 Tom Tromey 2005-05-13 20:10:00 UTC
One workaround is not to use -O2.
My current guess is that a fold-based optimization creates
a tree that the bytecode generator does not understand.
Comment 2 Tom Tromey 2005-05-13 20:17:20 UTC
Reduced test case

public class reduce {
  char[] source;
  public int compute(int pos) {
    for (int i = 0; i < pos; ++i)
      if (!(source[i] == ' ' || source[i] == '\t')) return -1;
    return pos;
  }
}
Comment 3 Tom Tromey 2005-05-13 21:24:14 UTC
I submitted a patch.
Comment 6 Tom Tromey 2005-05-15 19:13:42 UTC
Fix checked in.