User account creation filtered due to spam.

Bug 21662 - [4.0/4.1/4.2/4.3 Regression] Fields in interfaces not optimized when read from *.class, but optimized when read from *.java
Summary: [4.0/4.1/4.2/4.3 Regression] Fields in interfaces not optimized when read fro...
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.0.0
: P5 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
Keywords: missed-optimization
Depends on: 28067
  Show dependency treegraph
Reported: 2005-05-19 11:48 UTC by Jakub Jelinek
Modified: 2007-01-09 20:47 UTC (History)
4 users (show)

See Also:
Known to work: 3.2.3
Known to fail: 3.3.3 3.4.0 4.0.0 4.1.0
Last reconfirmed: 2006-01-29 00:29:26


Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2005-05-19 11:48:10 UTC
rm -rf test
mkdir test
cat > test/ <<EOF
package test;
public interface Configuration
  boolean INIT_LOAD_LIBRARY = false;
cat > test/ <<EOF
package test;
import test.Configuration;
public class Test
    if (Configuration.INIT_LOAD_LIBRARY)
gcj -C --classpath '' test/
mv test/Test.class{,.fromsrc}
gcj -C --classpath '' test/
gcj -C --classpath '' test/
mv test/Test.class{,.fromclass}
jcf-dump -c test/Test.class.fromsrc > test/fromsrc
jcf-dump -c test/Test.class.fromclass > test/fromclass
diff -u test/from{src,class}

In libjava build unless --enable-libgcj-multifile is used this has the bad
side effect that libgcj-4*.jar depends on the exact timing when doing make -jN
build (e.g. and are compiled about at the
same time, so if is compiled quickly enough
GdkTextLayout.class will not be as optimized as it could be, while
if compilation is tiny bit slower,'s
compilation will read and optimize the bool test out.
Comment 1 Andrew Pinski 2005-05-21 14:01:59 UTC
Confirmed, in 3.2.3, we produced the same class file.
Comment 2 Andrew Pinski 2005-05-21 14:03:12 UTC
(In reply to comment #1)
> Confirmed, in 3.2.3, we produced the same class file.
Oh and optimized it correctly.
Comment 3 Mark Mitchell 2005-08-22 03:34:31 UTC
Java bugs are not release-critical; removing target milestone.
Comment 4 Mark Mitchell 2006-05-25 02:36:07 UTC
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Comment 5 Tom Tromey 2007-01-09 20:47:38 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.