https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78836
Bug ID: 78836 Summary: ICE in get_source_location_for_substring, at input.c:1461 Product: gcc Version: 7.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: --- With some local changes to the gimple-ssa-sprintf.c pass I'm intermittently seeing the following ICE. It only shows up every few runs of the compiler and is sensitive to things like its pathname. It doesn't seem to be reproducible in GDB and Valgrind doesn't report anything. I'll see if I can reduce it to a test case independent of my local changes, or maybe build a sanitized GCC. I report now in case the problem jumps out at you David (or someone else familiar with this area). $ /home/msebor/build/gcc-78703/gcc/xgcc -B/home/msebor/build/gcc-78703/gcc -S -Wformat -Wformat-length=1 ice.c ... ice.c:85:6: internal compiler error: in get_source_location_for_substring, at input.c:1461 void test_sprintf_c_const (void) ^~~~~~~~~~~~~~~~~~~~ 0x1a1f144 get_source_location_for_substring(cpp_reader*, string_concat_db*, unsigned int, cpp_ttype, int, int, int, unsigned int*) /src/gcc/78703/gcc/input.c:1461 0x8496bd c_get_substring_location(substring_loc const&, unsigned int*) /src/gcc/78703/gcc/c-family/c-common.c:865 0xed797b substring_loc::get_location(unsigned int*) const /src/gcc/78703/gcc/substring-locations.c:194 0xed7667 format_warning_va(substring_loc const&, source_range const*, char const*, int, char const*, __va_list_tag (*) [1]) /src/gcc/78703/gcc/substring-locations.c:112 0xed792a format_warning_at_substring(substring_loc const&, source_range const*, char const*, int, char const*, ...) /src/gcc/78703/gcc/substring-locations.c:179 0x18c83cb add_bytes /src/gcc/78703/gcc/gimple-ssa-sprintf.c:2268 0x18c914b compute_format_length /src/gcc/78703/gcc/gimple-ssa-sprintf.c:2694 0x18ca0fc handle_gimple_call /src/gcc/78703/gcc/gimple-ssa-sprintf.c:3071 0x18ca1cd execute /src/gcc/78703/gcc/gimple-ssa-sprintf.c:3099 Please submit a full bug report, with preprocessed source if appropriate.