https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68638
Bug ID: 68638 Summary: [6 Regression] ICE in linemap_macro_map_lookup Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- The following test case triggers an ICE in linemap_macro_map_lookup, at libcpp/line-map.c:991 with yesterday's top of trunk. The test case compiles fine with GCC 5.1 so this is a regression. $ cat line-map-ice.c && /build/gcc-trunk-svn/gcc/xgcc -B /build/gcc-trunk-svn/gcc -O2 -S -Wall -fno-diagnostics-show-caret line-map-ice.c typedef union tree_node *tree; struct ht_identifier { const unsigned char *str; }; struct tree_identifier { struct ht_identifier id; }; union tree_node { struct tree_identifier identifier; }; static int foo (void) { tree val; return mep_pragma_lex (&val); } void bar (void) { tree val = 0; if (__extension__ ({val;})->identifier.id.str == 0) foo (); } line-map-ice.c: In function ‘foo’: line-map-ice.c:17:10: warning: implicit declaration of function ‘mep_pragma_lex’ [-Wimplicit-function-declaration] line-map-ice.c: In function ‘bar’: line-map-ice.c:20:6: internal compiler error: in linemap_macro_map_lookup, at libcpp/line-map.c:991 0x1795063 linemap_macro_map_lookup /home/msebor/scm/fsf/gcc-svn/libcpp/line-map.c:991 0x1794e4e linemap_lookup(line_maps*, unsigned int) /home/msebor/scm/fsf/gcc-svn/libcpp/line-map.c:925 0x1795fad linemap_unwind_to_first_non_reserved_loc(line_maps*, unsigned int, line_map const**) /home/msebor/scm/fsf/gcc-svn/libcpp/line-map.c:1629 0x1774164 expand_location_1 /home/msebor/scm/fsf/gcc-svn/gcc/input.c:159 0x177525d expand_location_to_spelling_point(unsigned int) /home/msebor/scm/fsf/gcc-svn/gcc/input.c:751 0x1775283 linemap_client_expand_location_to_spelling_point(unsigned int) /home/msebor/scm/fsf/gcc-svn/gcc/input.c:766 0x1796d6c rich_location::add_range(unsigned int, unsigned int, bool) /home/msebor/scm/fsf/gcc-svn/libcpp/line-map.c:2011 0x1796e44 rich_location::add_range(source_range, bool) /home/msebor/scm/fsf/gcc-svn/libcpp/line-map.c:2024 0x1796b7f rich_location::rich_location(line_maps*, unsigned int) /home/msebor/scm/fsf/gcc-svn/libcpp/line-map.c:1961 0x176d9ca warning_at(unsigned int, int, char const*, ...) /home/msebor/scm/fsf/gcc-svn/gcc/diagnostic.c:1024 0x1653666 find_explicit_erroneous_behaviour /home/msebor/scm/fsf/gcc-svn/gcc/gimple-ssa-isolate-paths.c:400 0x16538ef gimple_ssa_isolate_erroneous_paths /home/msebor/scm/fsf/gcc-svn/gcc/gimple-ssa-isolate-paths.c:505 0x16539e2 execute /home/msebor/scm/fsf/gcc-svn/gcc/gimple-ssa-isolate-paths.c:556 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.