Hit the return key too soon!-( On i686-apple-darwin9 bootstrapping revision 146855 fails when building libjava with -m64: ... libtool: compile: /opt/gcc/i686-darwin/gcc/gcj -B/opt/gcc/i686-darwin/i686-apple-darwin9/x86_64/libjava/ -B/opt/gcc/i686-darwin/gcc/ -ffloat-store -fomit-frame-pointer -Usun -fclasspath= -fbootclasspath=../../../../gcc-4.5-work/libjava/classpath/lib --encoding=UTF-8 -Wno-deprecated -fbootstrap-classes -g -O2 -m64 -fsource-filename=/opt/gcc/i686-darwin/i686-apple-darwin9/x86_64/libjava/classpath/lib/classes -fjni -findirect-dispatch -fno-indirect-classes -c @gnu-java-awt-peer-gtk.list -o gnu-java-awt-peer-gtk.o >/dev/null 2>&1 ../../../../../../gcc-4.5-work/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java: In class 'gnu.CORBA.Poa.gnuPOA$RefTemplate': ../../../../../../gcc-4.5-work/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java: In constructor '(gnu.CORBA.Poa.gnuPOA)': In file included from <built-in>:137: ../../../../../../gcc-4.5-work/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java:0: error: type mismatch in indirect reference struct java.lang.String[] void # VUSE <.MEM_215> #slot#8#31_227 = #ref#5#2_71->length; ../../../../../../gcc-4.5-work/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java:0: internal compiler error: verify_stmts failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. make[5]: *** [gnu-CORBA.lo] Error 1 make[5]: *** Waiting for unfinished jobs.... make[4]: *** [all-recursive] Error 1 make[3]: *** [multi-do] Error 1 make[2]: *** [all-multi] Error 2 make[1]: *** [all-target-libjava] Error 2 make: *** [all] Error 2
Looks like a duplicate of pr38374.
Does http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg01619.html fix this?
> Does http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg01619.html fix this? If you think so, I'll try ASAP. Thanks.
> Does http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg01619.html fix this? No! Still fails at revision 146999.
Fails after PRE. Reduced testcase requiring just a jc1 executable (assuming gcc is built in a subdirectory of the toplevel, i.e. ../configure): ./jc1 "../../libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA\$RefTemplate.class" "-fhash-synchronization" "-fuse-divide-subroutine" "-fcheck-references" "-fuse-boehm-gc" "-fkeep-inline-functions" "-fPIC" "-feliminate-unused-debug-symbols" "-quiet" "-mmacosx-version-min=10.5.6" "-m64" "-mtune=generic" "-g" "-O2" "-Wno-deprecated" "-ffloat-store" "-fomit-frame-pointer" "-fencoding=UTF-8" "-fbootstrap-classes" "-fjni" "-findirect-dispatch" "-fno-indirect-classes" "-fno-common" "-fbootclasspath=../../libjava/classpath/lib/" -o /dev/null
Ah, I didn't bootstrap so jc1 cannot be miscompiled.
I successfully bootstrapped libjava on powerpc-apple-darwin9 at revision 146999.
Subject: Re: [4.5 Regression] Bootstrap failure in libjava on i686-apple-darwin9 > I successfully bootstrapped libjava on powerpc-apple-darwin9 at revision > 146999. Interesting, can you try the command-line I posted on both ppc and i386, plus -fdump-tree-all-details, and see what the differences are in the tree dumps? Thanks!
> can you try the command-line I posted I guess it is from comment #6. Using a stupid copy and paste, I get RefTemplate: Undefined variable. After some trial and error, I ran /opt/gcc/gcc4.5w/libexec/gcc/i686-apple-darwin9/4.5.0/jc1 /opt/gcc/_gcc_clean/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -fPIC -feliminate-unused-debug-symbols -quiet -mmacosx-version-min=10.5.6 -m64 -mtune=generic -g -O2 -Wno-deprecated -ffloat-store -fomit-frame-pointer -fencoding=UTF-8 -fbootstrap-classes -fjni -findirect-dispatch -fno-indirect-classes -fno-common -fbootclasspath=/opt/gcc/_gcc_clean/libjava/classpath/lib/ -fdump-tree-all-details and the same variant on ppc, and got no errors but a bunch of files in /opt/gcc/_gcc_clean/libjava/classpath/lib/gnu/CORBA/Poa/ I have moved them to another directory, but don't know what to do with them . On Intel jc1 comes from revision 146795. For my last bootstrap I have only (successfully) build c, c++, and fortran, so if I need a matching jc1, I'll have to do a full (failing) bootstrap and won't have anything before tomorrow morning. Note, I really don't know anything about Java except the name.
Subject: Re: [4.5 Regression] Bootstrap failure in libjava on i686-apple-darwin9 The file name is really gnuPOA$RefTemplate.class
Subject: Re: [4.5 Regression] Bootstrap failure in libjava on i686-apple-darwin9 -mtune=generic should be eliminated from the ppc build, too (but intel fails also without it)
On i686-apple-darwin9: [ibook-dhum] bug/java_test% /opt/gcc/gcc4.5w/bin/gcj -v Using built-in specs. Reading specs from /Volumes/MacBook/opt/gcc/gcc4.5w/bin/../lib/gcc/i686-apple-darwin9/4.5.0/../../../libgcj.spec rename spec startfile to startfileorig rename spec lib to liborig Target: i686-apple-darwin9 Configured with: ../gcc-4.5-work/configure --prefix=/opt/gcc/gcc4.5w --mandir=/opt/gcc/gcc4.5w/share/man --infodir=/opt/gcc/gcc4.5w/share/info --build=i686-apple-darwin9 --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/usr --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --with-cloog=/sw --with-ppl=/sw Thread model: posix gcc version 4.5.0 20090426 (experimental) [trunk revision 146795p6] (GCC) but also (from the last bootstrap without java) [ibook-dhum] bug/java_test% /opt/gcc/gcc4.5w/bin/gcc -v Using built-in specs. Target: i686-apple-darwin9 Configured with: ../gcc-4.5-work/configure --prefix=/opt/gcc/gcc4.5w --mandir=/opt/gcc/gcc4.5w/share/man --infodir=/opt/gcc/gcc4.5w/share/info --build=i686-apple-darwin9 --enable-languages=c,c++,fortran --with-gmp=/sw --with-libiconv-prefix=/usr --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --with-cloog=/sw --with-ppl=/sw Thread model: posix gcc version 4.5.0 20090430 (experimental) [trunk revision 147015p6] (GCC) [ibook-dhum] bug/java_test% /opt/gcc/gcc4.5w/libexec/gcc/i686-apple-darwin9/4.5.0/jc1 /opt/gcc/_gcc_clean/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA\$RefTemplate.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -fPIC -feliminate-unused-debug-symbols -quiet -mmacosx-version-min=10.5.6 -m64 -mtune=generic -g -O2 -Wno-deprecated -ffloat-store -fomit-frame-pointer -fencoding=UTF-8 -fbootstrap-classes -fjni -findirect-dispatch -fno-indirect-classes -fno-common -fbootclasspath=/opt/gcc/_gcc_clean/libjava/classpath/lib/ -fdump-tree-all-details No error and I get 94 files from gnuPOA$RefTemplate.class.003t.original ... gnuPOA$RefTemplate.class.126t.optimized gnuPOA$RefTemplate.class.127t.nrv gnuPOA$RefTemplate.class.128t.blocks gnuPOA$RefTemplate.class.129t.final_cleanup gnuPOA$RefTemplate.class.206t.statistics gnuPOA$RefTemplate.class.s On powerpc-apple-darwin9, bootstrapped without fatal error: [karma] bug/java_test% /opt/gcc/gcc4.5w/bin/gcj -v Using built-in specs. Reading specs from /opt/gcc/gcc4.5w/lib/gcc/powerpc-apple-darwin9/4.5.0/../../../libgcj.spec rename spec startfile to startfileorig rename spec lib to liborig Target: powerpc-apple-darwin9 Configured with: ../gcc-4.5-work/configure --prefix=/opt/gcc/gcc4.5w --mandir=/opt/gcc/gcc4.5w/share/man --infodir=/opt/gcc/gcc4.5w/share/info --build=powerpc-apple-darwin9 --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/usr --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --with-cloog=/sw --with-ppl=/sw Thread model: posix gcc version 4.5.0 20090430 (experimental) [trunk revision 146999p3] (GCC) [karma] bug/java_test% /opt/gcc/gcc4.5w/bin/gcc -v Using built-in specs. Target: powerpc-apple-darwin9 Configured with: ../gcc-4.5-work/configure --prefix=/opt/gcc/gcc4.5w --mandir=/opt/gcc/gcc4.5w/share/man --infodir=/opt/gcc/gcc4.5w/share/info --build=powerpc-apple-darwin9 --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/usr --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --with-cloog=/sw --with-ppl=/sw Thread model: posix gcc version 4.5.0 20090430 (experimental) [trunk revision 146999p3] (GCC) [karma] bug/java_test% /opt/gcc/gcc4.5w/libexec/gcc/powerpc-apple-darwin9/4.5.0/jc1 /opt/gcc/_gcc_clean/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA\$RefTemplate.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -fPIC -feliminate-unused-debug-symbols -quiet -mmacosx-version-min=10.5.6 -m64 -g -O2 -Wno-deprecated -ffloat-store -fomit-frame-pointer -fencoding=UTF-8 -fbootstrap-classes -fjni -findirect-dispatch -fno-indirect-classes -fno-common -fbootclasspath=/opt/gcc/_gcc_clean/libjava/classpath/lib/ -fdump-tree-all-details gnu/CORBA/Poa/gnuPOA.java: In class 'gnu.CORBA.Poa.gnuPOA$RefTemplate': gnu/CORBA/Poa/gnuPOA.java: In constructor '(gnu.CORBA.Poa.gnuPOA)': In file included from <built-in>:0: gnu/CORBA/Poa/gnuPOA.java:0: error: type mismatch in indirect reference struct java.lang.String[] void # VUSE <.MEM_215> #slot#8#31_227 = #ref#5#2_71->length; gnu/CORBA/Poa/gnuPOA.java:0: internal compiler error: verify_stmts failed and I get 92 files gnuPOA$RefTemplate.class.003t.original ... gnuPOA$RefTemplate.class.126t.nrv gnuPOA$RefTemplate.class.128t.optimized gnuPOA$RefTemplate.class.209t.statistics gnuPOA$RefTemplate.class.s where the files gnuPOA$RefTemplate.class.127t.nrv gnuPOA$RefTemplate.class.129t.final_cleanup are missing.
Note 1: java is broken on ppc-darwin with -m64. Note 2: the error does not appear at -O1 and -m32 (default). Note 3: removing the -quiet and some other options, I get: [karma] bug/java_test% /opt/gcc/gcc4.5w/libexec/gcc/powerpc-apple-darwin9/4.5.0/jc1 /opt/gcc/_gcc_clean/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA\$RefTemplate.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -O2 -fencoding=UTF-8 -fbootstrap-classes -fjni -findirect-dispatch -fno-indirect-classes -fno-common -fbootclasspath=/opt/gcc/_gcc_clean/libjava/classpath/lib/ -fdump-tree-all class gnu.CORBA.Poa.gnuPOA$RefTemplate class java.lang.ObjectIn file included from <built-in>:0: gnu/CORBA/Poa/gnuPOA.java:0: warning: cannot find file for class org.omg.PortableInterceptor.ObjectReferenceTemplate (gnu.CORBA.Poa.gnuPOA)gnu/CORBA/Poa/gnuPOA.java: In class 'gnu.CORBA.Poa.gnuPOA$RefTemplate': gnu/CORBA/Poa/gnuPOA.java: In constructor '(gnu.CORBA.Poa.gnuPOA)': In file included from <built-in>:2: gnu/CORBA/Poa/gnuPOA.java:126: warning: cannot find file for class java.util.ArrayList gnu/CORBA/Poa/gnuPOA.java:127: warning: cannot find file for class gnu.CORBA.Poa.gnuPOA gnu/CORBA/Poa/gnuPOA.java:132: warning: cannot find file for class org.omg.PortableServer.POA In file included from <built-in>:2: gnu/CORBA/Poa/gnuPOA.java:138: warning: cannot find file for class java.lang.String gnu.CORBA.Poa.gnuPOA$RefTemplate.adapter_name() gnu.CORBA.Poa.gnuPOA$RefTemplate.orb_id()gnu/CORBA/Poa/gnuPOA.java: In method 'gnu.CORBA.Poa.gnuPOA$RefTemplate.orb_id()': In file included from <built-in>:2: gnu/CORBA/Poa/gnuPOA.java:162: warning: cannot find file for class gnu.CORBA.Poa.ORB_1_4 gnu.CORBA.Poa.gnuPOA$RefTemplate.server_id()gnu/CORBA/Poa/gnuPOA.java: In method 'gnu.CORBA.Poa.gnuPOA$RefTemplate.server_id()': gnu/CORBA/Poa/gnuPOA.java:170: warning: cannot find file for class gnu.CORBA.OrbFunctional gnu.CORBA.Poa.gnuPOA$RefTemplate.make_object(java.lang.String,byte[]) gnu.CORBA.Poa.gnuPOA$RefTemplate._truncatable_ids()gnu/CORBA/Poa/gnuPOA.java: At top level: gnu/CORBA/Poa/gnuPOA.java:186: warning: cannot find file for class java.lang.Class Analyzing compilation unit Performing interprocedural optimizations <visibility> <early_local_cleanups> <summary generate> <cp> <inline> <static-var> <pure-const>Assembling functions: gnu.CORBA.Poa.gnuPOA$RefTemplate._truncatable_ids() gnu.CORBA.Poa.gnuPOA$RefTemplate.server_id() gnu.CORBA.Poa.gnuPOA$RefTemplate.make_object(java.lang.String,byte[]) gnu.CORBA.Poa.gnuPOA$RefTemplate.orb_id() gnu.CORBA.Poa.gnuPOA$RefTemplate.adapter_name() (gnu.CORBA.Poa.gnuPOA)gnu/CORBA/Poa/gnuPOA.java: In constructor '(gnu.CORBA.Poa.gnuPOA)': In file included from <built-in>:0: gnu/CORBA/Poa/gnuPOA.java:0: error: type mismatch in indirect reference struct java.lang.String[] void # VUSE <.MEM_11> #slot#8#31_225 = #ref#5#2_129->length; gnu/CORBA/Poa/gnuPOA.java:0: internal compiler error: verify_stmts failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Java has always been broken at -m64 on ppc-darwin since no one has ever ported ffi to work on ppc64 for darwin.
> Java has always been broken at -m64 on ppc-darwin since no one has ever ported > ffi to work on ppc64 for darwin. This is precisely why I have tried the test without -m64.
At revision 147032 on i686-apple-darwin9 the bootstrap still fails. Using the built jc1 I get: [ibook-dhum] bug/java_test% /opt/gcc/i686-darwin/gcc/jc1 /opt/gcc/_gcc_clean/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA\$RefTemplate.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -quiet -mmacosx-version-min=10.5.6 -mtune=generic -O2 -Wno-deprecated -fencoding=UTF-8 -fbootstrap-classes -fjni -findirect-dispatch -fno-indirect-classes -fno-common -fbootclasspath=/opt/gcc/_gcc_clean/libjava/classpath/lib/ -fdump-tree-all-details gnu/CORBA/Poa/gnuPOA.java: In class 'gnu.CORBA.Poa.gnuPOA$RefTemplate': gnu/CORBA/Poa/gnuPOA.java: In constructor '(gnu.CORBA.Poa.gnuPOA)': In file included from <built-in>:0: gnu/CORBA/Poa/gnuPOA.java:0: error: type mismatch in indirect reference struct java.lang.String[] void # VUSE <.MEM_11> #slot#8#31_225 = #ref#5#2_135->length; gnu/CORBA/Poa/gnuPOA.java:0: internal compiler error: verify_stmts failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Hm, with a cross configured like configure --disable-nls --enable-languages=java --target=i686-apple-darwin9 and make all-gcc I just get gcc$ ./jc1 -quiet ~/src/trunk/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA\$RefTemplate.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -quiet -mmacosx-version-min=10.5.6 -mtune=generic -O2 -Wno-deprecated -fencoding=UTF-8 -fbootstrap-classes -fjni -findirect-dispatch -fno-indirect-classes -fno-common -fbootclasspath=~/src/trunk/libjava/classpath/lib Segmentation fault :/ So I still cannot reproduce this. The segfault happens because the FE endlessly recurses in #295 0x080ddae8 in layout_class_methods (this_class=0xb7761a8c) at /home/richard/src/trunk/gcc/java/class.c:2559 2559 layout_class_methods (super_class); (gdb) #296 0x080ddae8 in layout_class_methods (this_class=0xb7761a8c) at /home/richard/src/trunk/gcc/java/class.c:2559 2559 layout_class_methods (super_class); ...
The ICE is also produced by prev-gcc/jc1 [ibook-dhum] bug/java_test% /opt/gcc/i686-darwin/prev-gcc/jc1 /opt/gcc/_gcc_clean/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA\$RefTemplate.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -quiet -mmacosx-version-min=10.5.6 -mtune=generic -O2 -Wno-deprecated -fencoding=UTF-8 -fbootstrap-classes -fjni -findirect-dispatch -fno-indirect-classes -fno-common -fbootclasspath=/opt/gcc/_gcc_clean/libjava/classpath/lib/ -fdump-tree-all-details gnu/CORBA/Poa/gnuPOA.java: In class 'gnu.CORBA.Poa.gnuPOA$RefTemplate': gnu/CORBA/Poa/gnuPOA.java: In constructor '(gnu.CORBA.Poa.gnuPOA)': In file included from <built-in>:0: gnu/CORBA/Poa/gnuPOA.java:0: error: type mismatch in indirect reference struct java.lang.String[] void # VUSE <.MEM_11> #slot#8#31_225 = #ref#5#2_135->length; gnu/CORBA/Poa/gnuPOA.java:0: internal compiler error: verify_stmts failed
Also reproducible with compiler to powerpc-apple-darwin, same error message.
> Java has always been broken at -m64 on ppc-darwin since no one has ever ported > ffi to work on ppc64 for darwin. But jc1 builds if you just "make jc1", and it exhibits the same bug.
> But jc1 builds if you just "make jc1", and it exhibits the same bug. The difference between ppc and intel, is that for the former it does not break bootstrap. Any idea why?
Now this is funny. I get the same error even with a cross from i686-darwin to i686-pc-linux-gnu!
Created attachment 17792 [details] debug output with -fdump-tree-all-details-blocks-vops
Ha, that helped. From looking at the dumps, can you check Index: gcc/tree-ssa-pre.c =================================================================== --- gcc/tree-ssa-pre.c (revision 147054) +++ gcc/tree-ssa-pre.c (working copy) @@ -4215,7 +4215,9 @@ eliminate (void) /* If there is a single use only, propagate the equivalency instead of keeping the copy. */ if (TREE_CODE (lhs) == SSA_NAME - && single_imm_use (lhs, &use_p, &use_stmt)) + && single_imm_use (lhs, &use_p, &use_stmt) + && may_propagate_copy (USE_FROM_PTR (use_p), + gimple_assign_rhs1 (stmt))) { SET_USE (use_p, gimple_assign_rhs1 (stmt)); update_stmt (use_stmt); ?
Subject: Bug 39940 Author: rguenth Date: Sat May 2 17:50:21 2009 New Revision: 147065 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147065 Log: 2009-05-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/39940 * tree-ssa-pre.c (eliminate): Make sure we may propagate before doing so. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-ssa-pre.c
Supposedly fixed.
Yes, fixed.
what about 4.4?
The specific code path doesn't exist in 4.4.