If you enable gcc/lto-streamer.h:LTO_STREAMER_DEBUG, the libgomp.fortran/declare-simd-4.f90 test case will run into an ICE, because of gcc/lto-streamer.c:lto_orig_address_remove failing in "gcc_assert (slot)". If Intel MIC (emulated) offloading is enabled, libgomp.c/examples-4/declare_target-5.c and libgomp.fortran/examples-4/declare_target-5.f90 fail in the same way. I have not analyzed whether that is a real problem, or "just" a problem with LTO_STREAMER_DEBUG -- but bootstrap build and full testsuite run with LTO_STREAMER_DEBUG enabled doesn't exhibit any additional problems.
Can I reproduce it on a normal GCC (no target compiler) on my x86_64-linux-gnu target? After setting the macro, following works for me: ./gcc/xgcc -B gcc /home/marxin/Programming/gcc/libgomp/testsuite/libgomp.fortran/declare-simd-4.f90 -flto -c -mavx -fno-use-linker-plugin -fno-inline
(In reply to Martin Liška from comment #1) > Can I reproduce it on a normal GCC (no target compiler) on my > x86_64-linux-gnu target? > > After setting the macro, following works for me: > ./gcc/xgcc -B gcc /home/marxin/Programming/gcc/libgomp/testsuite/libgomp.fortran/declare-simd-4.f90 -flto -c -mavx -fno-use-linker-plugin -fno-inline Drop "-c", and "-fno-use-linker-plugin", and add "-fopenmp" (and "-Bx86_64-pc-linux-gnu/libgomp/{,.libs/}", or similar): $ build-gcc/gcc/xgcc -Bbuild-gcc/gcc/ -Bbuild-gcc/x86_64-pc-linux-gnu/libgomp/{,.libs/} source-gcc/libgomp/testsuite/libgomp.fortran/declare-simd-4.f90 -flto -fopenmp lto1: internal compiler error: in lto_orig_address_remove, at lto-streamer.c:369 0x901fbd lto_orig_address_remove(tree_node*) [...]/source-gcc/gcc/lto-streamer.c:369 0x902f77 lto_read_tree [...]/source-gcc/gcc/lto-streamer-in.c:1363 0x902f77 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) [...]/source-gcc/gcc/lto-streamer-in.c:1475 0x903192 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned int*) [...]/source-gcc/gcc/lto-streamer-in.c:1387 0x5c02a6 lto_read_decls [...]/source-gcc/gcc/lto/lto.c:1694 0x5c2f5d lto_file_finalize [...]/source-gcc/gcc/lto/lto.c:2038 0x5c2f5d lto_create_files_from_ids [...]/source-gcc/gcc/lto/lto.c:2048 0x5c2f5d lto_file_read [...]/source-gcc/gcc/lto/lto.c:2089 0x5c2f5d read_cgraph_and_symbols [...]/source-gcc/gcc/lto/lto.c:2801 0x5c2f5d lto_main() [...]/source-gcc/gcc/lto/lto.c:3306 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. lto-wrapper: fatal error: build-gcc/gcc/xgcc returned 1 exit status compilation terminated. /usr/bin/ld: lto-wrapper failed collect2: error: ld returned 1 exit status
Confirmed, I've got patch for that.
Author: marxin Date: Tue May 2 15:00:47 2017 New Revision: 247501 URL: https://gcc.gnu.org/viewcvs?rev=247501&root=gcc&view=rev Log: Remove LTO_STREAMER_DEBUG (PR lto/79489). 2017-05-02 Martin Liska <mliska@suse.cz> PR lto/79489. * lto-streamer-in.c (lto_read_tree_1): Remove LTO_STREAMER_DEBUG. * lto-streamer.c (struct tree_hash_entry): Likewise. (struct tree_entry_hasher): Likewise. (tree_entry_hasher::hash): Likewise. (tree_entry_hasher::equal): Likewise. (lto_streamer_init): Likewise. (lto_orig_address_map): Likewise. (lto_orig_address_get): Likewise. (lto_orig_address_remove): Likewise. * lto-streamer.h: Likewise. * tree-streamer-in.c (streamer_alloc_tree): Likewise. * tree-streamer-out.c (streamer_write_tree_header): Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/lto-streamer-in.c trunk/gcc/lto-streamer.c trunk/gcc/lto-streamer.h trunk/gcc/tree-streamer-in.c trunk/gcc/tree-streamer-out.c
Fixed on trunk.
(In reply to Martin Liška from comment #4) > Remove LTO_STREAMER_DEBUG ([...]). Thanks! I'm fine with that -- but you do have verified that it's really just LTO_STREAMER_DEBUG that was broken, and not some lingering OMP/SIMD problem?
(In reply to Thomas Schwinge from comment #6) > (In reply to Martin Liška from comment #4) > > Remove LTO_STREAMER_DEBUG ([...]). > > Thanks! I'm fine with that -- but you do have verified that it's really > just LTO_STREAMER_DEBUG that was broken, and not some lingering OMP/SIMD > problem? Yes, would be fixed by https://github.com/marxin/gcc/commit/978c7e3436f91f3a1e94dfb63ba79e72b4f35715
Thanks for confirming, and sorry for the extra work that you did. :-/
(In reply to Thomas Schwinge from comment #8) > Thanks for confirming, and sorry for the extra work that you did. :-/ No problem ;)