This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug lto/41932] New: LTO ICE when compiling ocaml trunk (incompatible type)


When trying to compile ocaml-trunk (svn revision 9408 of ocaml trunk) with
gcc-trunk rev 153839, gcc LTO make an ICE.

Step by step instructions to reproduce the bug (on a Linux AMD64 system, eg
Debian/Sid or Ubuntu/Karmic etc...)

0. You should have gcc-trunk already built; ensure (perhaps with some PATH
trick that your gcc-trunk is indeed invoked as gcc-trunk, or replace gcc-trunk
by what is appropriate for you
 % gcc-trunk -v 
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /usr/src/Lang/gcc-trunk-bstarynk/configure
--program-suffix=-trunk --libdir=/usr/local/lib/gcc-trunk
--libexecdir=/usr/local/libexec/gcc-trunk
--with-gxx-include-dir=/usr/local/lib/gcc-trunk/include/c++/ --disable-multilib
--enable-languages=c,c++ --enable-lto --enable-plugins --enable-maintainer-mode
: (reconfigured) /usr/src/Lang/gcc-trunk-bstarynk/configure
--program-suffix=-trunk --libdir=/usr/local/lib/gcc-trunk
--libexecdir=/usr/local/libexec/gcc-trunk
--with-gxx-include-dir=/usr/local/lib/gcc-trunk/include/c++/ --disable-multilib
--enable-languages=c,c++ --enable-lto --enable-plugins --enable-maintainer-mode
: (reconfigured) /usr/src/Lang/gcc-trunk-bstarynk/configure
--program-suffix=-trunk --libdir=/usr/local/lib/gcc-trunk
--libexecdir=/usr/local/libexec/gcc-trunk
--with-gxx-include-dir=/usr/local/lib/gcc-trunk/include/c++/ --disable-multilib
--enable-lto --enable-plugins --enable-maintainer-mode
--enable-languages=c,c++,lto --no-create --no-recursion : (reconfigured)
/usr/src/Lang/gcc-trunk-bstarynk/configure --program-suffix=-trunk
--libdir=/usr/local/lib/gcc-trunk --libexecdir=/usr/local/libexec/gcc-trunk
--with-gxx-include-dir=/usr/local/lib/gcc-trunk/include/c++/ --disable-multilib
--enable-lto --enable-plugins --enable-maintainer-mode
--enable-languages=c,c++,lto --no-create --no-recursion : (reconfigured)
/usr/src/Lang/gcc-trunk-bstarynk/configure --program-suffix=-trunk
--libdir=/usr/local/lib/gcc-trunk --libexecdir=/usr/local/libexec/gcc-trunk
--with-gxx-include-dir=/usr/local/lib/gcc-trunk/include/c++/ --disable-multilib
--enable-lto --enable-plugins --enable-maintainer-mode
--enable-languages=c,c++,lto --no-create --no-recursion
Thread model: posix
gcc version 4.5.0 20091103 (experimental) (GCC) 


1. Retrieve ocaml-trunk rev 9408 with
  svn co -r 9408 http://caml.inria.fr/svn/ocaml/trunk ocaml-trunk-r9408

2. Go into that directory
  cd ocaml-trunk-r9408

3. Configure Ocaml to be compiled with gcc-trunk -flto -O2
  ./configure -cc 'gcc-trunk -flto -O2'
Note that ocaml does not use autoconf. Its configure script is handcrafted.

4. Build the bytecode variant of ocaml. This should crash gcc-trunk.
   make -w world
gcc-trunk -flto -O2 -c -DCAML_NAME_SPACE -O -fno-defer-pop -Wall
-D_FILE_OFFSET_BITS=64 -D_REENTRANT  -fPIC finalise.c
mv finalise.o finalise.pic.o
gcc-trunk -flto -O2 -c -DCAML_NAME_SPACE -O -fno-defer-pop -Wall
-D_FILE_OFFSET_BITS=64 -D_REENTRANT  -fPIC custom.c
mv custom.o custom.pic.o
gcc-trunk -flto -O2 -c -DCAML_NAME_SPACE -O -fno-defer-pop -Wall
-D_FILE_OFFSET_BITS=64 -D_REENTRANT  -fPIC dynlink.c
mv dynlink.o dynlink.pic.o
gcc-trunk -flto -O2 -c -DCAML_NAME_SPACE -O -fno-defer-pop -Wall
-D_FILE_OFFSET_BITS=64 -D_REENTRANT  -fPIC unix.c
mv unix.o unix.pic.o
gcc-trunk -flto -O2 -c -DCAML_NAME_SPACE -O -fno-defer-pop -Wall
-D_FILE_OFFSET_BITS=64 -D_REENTRANT  -fPIC main.c
mv main.o main.pic.o
gcc-trunk -flto -O2 -shared -o libcamlrun_shared.so interp.pic.o misc.pic.o
stacks.pic.o fix_code.pic.o startup.pic.o freelist.pic.o major_gc.pic.o
minor_gc.pic.o memory.pic.o alloc.pic.o roots.pic.o globroots.pic.o fail.pic.o
signals.pic.o signals_byt.pic.o printexc.pic.o backtrace.pic.o compare.pic.o
ints.pic.o floats.pic.o str.pic.o array.pic.o io.pic.o extern.pic.o
intern.pic.o hash.pic.o sys.pic.o meta.pic.o parsing.pic.o gc_ctrl.pic.o
terminfo.pic.o md5.pic.o obj.pic.o lexing.pic.o callback.pic.o debugger.pic.o
weak.pic.o compact.pic.o finalise.pic.o custom.pic.o dynlink.pic.o unix.pic.o
main.pic.o -lm  -ldl -lcurses -lpthread
gc_ctrl.c:44:16: warning: type of 'caml_major_heap_increment' does not match
original declaration
major_gc.c:33:8: note: previously declared here
lto1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: /usr/local/bin/gcc-trunk returned 1 exit status
collect2: lto-wrapper returned 1 exit status
make[2]: *** [libcamlrun_shared.so] Error 1
make[2]: Leaving directory `/usr/src/Lang/ocaml-trunk-r9408/byterun'
make[1]: *** [coldstart] Error 2
make[1]: Leaving directory `/usr/src/Lang/ocaml-trunk-r9408'
make: *** [world] Error 2
make: Leaving directory `/usr/src/Lang/ocaml-trunk-r9408'


The diagnostic is right: 

in gc_ctrl.c:
extern asize_t caml_major_heap_increment;  /* bytes; see major_gc.c */

in major_gc.c:
intnat caml_major_heap_increment; 

But the GCC crash is wrong.

I was not able to reproduce the crash with two small files (a.c & b.c)
containing almost only the above suspicious lines.


I am sorry for such a big bug report.


-- 
           Summary: LTO ICE when compiling ocaml trunk (incompatible type)
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bstarynk at gcc dot gnu dot org
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41932


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