https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71953
Bug ID: 71953 Summary: ICE using sanitizers with PCH Product: gcc Version: 7.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- This happens when I try to enable asan and/or ubsan in the libstdc++ testsuite. Possibly component should be pch, but I want someone to actually look at it ;) I can't reproduce it with preprocessed source, because I get an invalid-pch error unless it's done in the build tree when the PCH file is present. With suitable values of SRCDIR, OBJDIR and TARGET: echo | $OBJDIR/gcc/xg++ -B$OBJDIR/gcc -fsanitize=address -g -O -c -nostdinc++ -I $OBJDIR/$TARGET/libstdc++-v3/include/$TARGET -include bits/stdc++.h -x c++ - <stdin>: In function ‘void __static_initialization_and_destruction_0(int, int)’: <stdin>:1:0: internal compiler error: Segmentation fault 0xd273ef crash_signal /home/jwakely/src/gcc/gcc/gcc/toplev.c:335 0xfbdce8 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) /home/jwakely/src/gcc/gcc/gcc/tree.h:3136 0xfbdce8 build_call_expr_loc_array(unsigned int, tree_node*, int, tree_node**) /home/jwakely/src/gcc/gcc/gcc/tree.c:11161 0xfbdf4d build_call_expr(tree_node*, int, ...) /home/jwakely/src/gcc/gcc/gcc/tree.c:11211 0xd40ea6 asan_dynamic_init_call(bool) /home/jwakely/src/gcc/gcc/gcc/asan.c:2178 0x6ebf38 do_static_initialization_or_destruction /home/jwakely/src/gcc/gcc/gcc/cp/decl2.c:3848 0x6f0ee7 c_parse_final_cleanups() /home/jwakely/src/gcc/gcc/gcc/cp/decl2.c:4676 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.