http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50222
Bug #: 50222 Summary: ICE with -O{1,2} -funswitch-loops -ftree-loop-distribution Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: franxisco1988+...@gmail.com Created attachment 25123 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25123 Temporary saved file I'm hitting an ICE in the attached file, the ICE happens with either -O1 and -O2 with gcc being killed for a segmentation fault. Here is the output of $ LANG="C" gcc -O1 -funswitch-loops -ftree-loop-distribution -I. -I.. -I../.. nutenc.c -include libavutil/internal.h -I ../../ -c -save-temps -v Using built-in specs. Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/vanilla.specs Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/hardenednossp.specs Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/hardenednopie.specs COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.1/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-esp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.6.1/python --enable-checking=release --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened 4.6.1-r1 p1.0, pie-0.4.5' Thread model: posix gcc version 4.6.1 (Gentoo Hardened 4.6.1-r1 p1.0, pie-0.4.5) COLLECT_GCC_OPTIONS='-O1' '-funswitch-loops' '-ftree-loop-distribution' '-I' '.' '-I' '..' '-I' '../..' '-include' 'libavutil/internal.h' '-I' '../../' '-c' '-save-temps' '-v' '-mtune=generic' '-march=x86-64' /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.1/cc1 -E -quiet -v -I . -I .. -I ../.. -I ../../ -include libavutil/internal.h nutenc.c -D_FORTIFY_SOURCE=2 -mtune=generic -march=x86-64 -funswitch-loops -ftree-loop-distribution -O1 -fpch-preprocess -o nutenc.i ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/../../../../x86_64-pc-linux-gnu/include" ignoring duplicate directory "../../" #include "..." search starts here: #include <...> search starts here: . .. ../.. /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/include /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS='-O1' '-funswitch-loops' '-ftree-loop-distribution' '-I' '.' '-I' '..' '-I' '../..' '-include' 'libavutil/internal.h' '-I' '../../' '-c' '-save-temps' '-v' '-mtune=generic' '-march=x86-64' /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.1/cc1 -fpreprocessed nutenc.i -quiet -dumpbase nutenc.c -mtune=generic -march=x86-64 -auxbase nutenc -O1 -version -funswitch-loops -ftree-loop-distribution -o nutenc.s GNU C (Gentoo Hardened 4.6.1-r1 p1.0, pie-0.4.5) version 4.6.1 (x86_64-pc-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C (Gentoo Hardened 4.6.1-r1 p1.0, pie-0.4.5) version 4.6.1 (x86_64-pc-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: ee3b77d3e57fd2e78f1e57adb19b4a68 nutenc.c: In function 'write_header': nutenc.c:580:12: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://bugs.gentoo.org/> for instructions. And the output of $ LANG="C" gcc -O2 -funswitch-loops -ftree-loop-distribution -I. -I.. -I../.. nutenc.c -include libavutil/internal.h -I ../../ -c -save-temps -v Using built-in specs. Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/vanilla.specs Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/hardenednossp.specs Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/hardenednopie.specs COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.1/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-esp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.6.1/python --enable-checking=release --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened 4.6.1-r1 p1.0, pie-0.4.5' Thread model: posix gcc version 4.6.1 (Gentoo Hardened 4.6.1-r1 p1.0, pie-0.4.5) COLLECT_GCC_OPTIONS='-O2' '-funswitch-loops' '-ftree-loop-distribution' '-I' '.' '-I' '..' '-I' '../..' '-include' 'libavutil/internal.h' '-I' '../../' '-c' '-save-temps' '-v' '-mtune=generic' '-march=x86-64' /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.1/cc1 -E -quiet -v -I . -I .. -I ../.. -I ../../ -include libavutil/internal.h nutenc.c -D_FORTIFY_SOURCE=2 -mtune=generic -march=x86-64 -funswitch-loops -ftree-loop-distribution -O2 -fpch-preprocess -o nutenc.i ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/../../../../x86_64-pc-linux-gnu/include" ignoring duplicate directory "../../" #include "..." search starts here: #include <...> search starts here: . .. ../.. /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/include /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS='-O2' '-funswitch-loops' '-ftree-loop-distribution' '-I' '.' '-I' '..' '-I' '../..' '-include' 'libavutil/internal.h' '-I' '../../' '-c' '-save-temps' '-v' '-mtune=generic' '-march=x86-64' /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.1/cc1 -fpreprocessed nutenc.i -quiet -dumpbase nutenc.c -mtune=generic -march=x86-64 -auxbase nutenc -O2 -version -funswitch-loops -ftree-loop-distribution -o nutenc.s GNU C (Gentoo Hardened 4.6.1-r1 p1.0, pie-0.4.5) version 4.6.1 (x86_64-pc-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C (Gentoo Hardened 4.6.1-r1 p1.0, pie-0.4.5) version 4.6.1 (x86_64-pc-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: ee3b77d3e57fd2e78f1e57adb19b4a68 nutenc.c: In function 'write_header': nutenc.c:580:12: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://bugs.gentoo.org/> for instructions. The backtrace by gdb is the following: #0 0x00000000008796bf in rename_use_op (bb=0x7ffff67d0b60) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-vect-loop-manip.c:55 #1 rename_variables_in_bb (bb=0x7ffff67d0b60) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-vect-loop-manip.c:95 #2 0x000000000087971e in rename_variables_in_loop (loop=0x7ffff67ac908) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-vect-loop-manip.c:111 #3 0x00000000007ab38a in copy_loop_before (loop=<value optimized out>, stmts=<value optimized out>) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-loop-distribution.c:137 #4 generate_loops_for_partition (loop=<value optimized out>, stmts=<value optimized out>) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-loop-distribution.c:171 #5 generate_code_for_partition (loop=<value optimized out>, stmts=<value optimized out>) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-loop-distribution.c:395 #6 ldist_gen (loop=<value optimized out>, stmts=<value optimized out>) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-loop-distribution.c:1133 #7 distribute_loop (loop=<value optimized out>, stmts=<value optimized out>) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-loop-distribution.c:1218 #8 distribute_loop (loop=<value optimized out>, stmts=<value optimized out>) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-loop-distribution.c:1160 #9 0x00000000007ab78c in tree_loop_distribution () at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-loop-distribution.c:1274 #10 0x00000000006d2c51 in execute_one_pass (pass=0x112e0a0) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/passes.c:1556 #11 0x00000000006d2f1d in execute_pass_list (pass=0x112e0a0) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/passes.c:1611 #12 0x00000000006d2f2f in execute_pass_list (pass=0x112f180) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/passes.c:1612 #13 0x00000000006d2f2f in execute_pass_list (pass=0x112e400) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/passes.c:1612 #14 0x00000000007b32e5 in tree_rest_of_compilation (fndecl=0x7ffff6bb5900) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/tree-optimize.c:422 #15 0x000000000090db6f in cgraph_expand_function (node=0x7ffff6bcf2c0) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/cgraphunit.c:1576 #16 0x000000000090f958 in cgraph_expand_all_functions () at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/cgraphunit.c:1635 #17 cgraph_optimize () at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/cgraphunit.c:1899 #18 0x000000000090fd9a in cgraph_finalize_compilation_unit () at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/cgraphunit.c:1096 #19 0x00000000004b5685 in c_write_global_declarations () at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/c-decl.c:9871 #20 0x0000000000772758 in compile_file (argc=26, argv=0x7fffffffcac8) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/toplev.c:591 #21 do_compile (argc=26, argv=0x7fffffffcac8) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/toplev.c:1900 #22 toplev_main (argc=26, argv=0x7fffffffcac8) at /var/tmp/portage/sys-devel/gcc-4.6.1-r1/work/gcc-4.6.1/gcc/toplev.c:1963 #23 0x00007ffff6f74d6d in __libc_start_main () from /lib64/libc.so.6 #24 0x00000000004a3165 in _start ()