https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108307
Bug ID: 108307
Summary: ICE compiling .S file with
-fdiagnostics-format=sarif-file
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: diagnostic, ice-on-valid-code
Severity: normal
Priority: P3
Component: driver
Assignee: unassigned at gcc dot gnu.org
Reporter: dmalcolm at gcc dot gnu.org
Target Milestone: ---
Given:
$ touch empty.S
$ ./xgcc -B. -c empty.S
succeeds, but:
$ ./xgcc -B. -c empty.S -fdiagnostics-format=sarif-file
ICEs with:
0x11076c6 crash_signal
../../src/gcc/toplev.cc:314
0x226a532 xstrdup
../../src/libiberty/xstrdup.c:33
0x21dc81e diagnostic_output_format_init_sarif_file(diagnostic_context*, char
const*)
../../src/gcc/diagnostic-format-sarif.cc:1585
0x21b9cba common_handle_option(gcc_options*, gcc_options*, cl_decoded_option
const*, unsigned int, int, unsigned int, cl_option_handlers const*,
diagnostic_context*, void (*)())
../../src/gcc/opts.cc:2858
0x21beaae handle_option
../../src/gcc/opts-common.cc:1248
0x21bebf8 read_cmdline_option(gcc_options*, gcc_options*, cl_decoded_option*,
unsigned int, unsigned int, cl_option_handlers const*, diagnostic_context*)
../../src/gcc/opts-common.cc:1578
0x10126d2 read_cmdline_options
../../src/gcc/opts-global.cc:239
0x10126d2 decode_options(gcc_options*, gcc_options*, cl_decoded_option*,
unsigned int, unsigned int, diagnostic_context*, void (*)())
../../src/gcc/opts-global.cc:321
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
due to NULL base_file_name here.
#2 0x00000000021dc81f in diagnostic_output_format_init_sarif_file
(context=0x2fe61c0 <global_diagnostic_context>, base_file_name=0x0)
at ../../src/gcc/diagnostic-format-sarif.cc:1585
warning: Source file is more recent than executable.
1585 sarif_output_base_file_name = xstrdup (base_file_name);
Similar to PR 106133 (but for sarif-file, rather than json-file)