https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87562

            Bug ID: 87562
           Summary: ICE in in linemap_position_for_line_and_column, at
                    libcpp/line-map.c:848
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

I get an ICE when building 502.gcc_r from SPEC2017 intrate for aarch64:
$ gcc -c -o dbxout.o -DSPEC -DNDEBUG -I. -I./include -I./spec_qsort -DSPEC_502
-DSPEC_AUTO_SUPPRESS_OPENMP -DIN_GCC -DHAVE_CONFIG_H     -DSPEC_LP64  dbxout.c

during GIMPLE pass: printf-return-value
dbxout.c: In function 'dbxout_stab_value_internal_label':
dbxout.c:508:1: internal compiler error: in
linemap_position_for_line_and_column, at libcpp/line-map.c:848
508 | dbxout_stab_value_internal_label (const char *stem, int *counterp)
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x151f447 linemap_position_for_line_and_column(line_maps*, line_map_ordinary
const*, unsigned int, unsigned int)
        $SRC/libcpp/line-map.c:848
0x1502388 get_substring_ranges_for_loc
        $SRC/gcc/input.c:1465
0x1502772 get_source_location_for_substring(cpp_reader*, string_concat_db*,
unsigned int, cpp_ttype, int, int, int, unsigned int*)
        $SRC/gcc/input.c:1517
0x68071f c_get_substring_location(substring_loc const&, unsigned int*)
        $SRC/gcc/c-family/c-common.c:867
0xbf8f8a substring_loc::get_location(unsigned int*) const
        $SRC/gcc/substring-locations.c:284
0xbf8fef format_string_diagnostic_t::emit_warning_n_va(int, unsigned long, char
const*, char const*, __va_list_tag (*) [1]) const
        $SRC/gcc/substring-locations.c:156
0xbf9258 format_string_diagnostic_t::emit_warning_va(int, char const*,
__va_list_tag (*) [1]) const
        $SRC/gcc/substring-locations.c:241
0x13cbd6f fmtwarn
        $SRC/gcc/gimple-ssa-sprintf.c:472
0x13cc83e maybe_warn
        $SRC/gcc/gimple-ssa-sprintf.c:2564
0x13d2229 format_directive
        $SRC/gcc/gimple-ssa-sprintf.c:2823
0x13d2229 compute_format_length
        $SRC/gcc/gimple-ssa-sprintf.c:3502
0x13d2229 handle_gimple_call
        $SRC/gcc/gimple-ssa-sprintf.c:3988
0x13d2229 before_dom_children
        $SRC/gcc/gimple-ssa-sprintf.c:4027
0x1384ad7 dom_walker::walk(basic_block_def*)
        $SRC/gcc/domwalk.c:353
0x13ce8ed execute
        $SRC/gcc/gimple-ssa-sprintf.c:4053
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.

Unfortunately this is not reproducible when compiling with -save-temps or when
using the preprocessed file, so I can't reduce it.

Reply via email to