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

            Bug ID: 127930
           Summary: ICE: SIGSEGV in get_use_count (file-cache.cc:64) with
                    --param=file-cache-files=0
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: diagnostics
          Assignee: dmalcolm at redhat dot com
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

$ cat foo.c
struct {};

$ x86_64-pc-linux-gnu-gcc --param=file-cache-files=0 foo.c -wrapper valgrind,-q
==222835== Invalid read of size 4
==222835==    at 0x32A399B: get_use_count (file-cache.cc:64)
==222835==    by 0x32A399B:
diagnostics::file_cache::evicted_cache_tab_entry(unsigned int*)
(file-cache.cc:320)
==222835==    by 0x32A4607: diagnostics::file_cache::add_file(char const*)
(file-cache.cc:365)
==222835==    by 0x32A51B2: lookup_or_add_file (file-cache.cc:502)
==222835==    by 0x32A51B2: diagnostics::file_cache::get_source_line(char
const*, int) (file-cache.cc:943)
==222835==    by 0x3327C1D:
location_compute_display_column(diagnostics::file_cache&, expanded_location,
cpp_char_column_policy const&) (input.cc:374)
==222835==    by 0x329335B: convert_column_unit (context.cc:778)
==222835==    by 0x329335B:
diagnostics::column_options::convert_column(diagnostics::file_cache&,
expanded_location) const (context.cc:793)
==222835==    by 0x329346D: converted_column (context.cc:811)
==222835==    by 0x329346D:
diagnostics::column_policy::get_location_text(expanded_location const&, bool,
bool) const (context.cc:830)
==222835==    by 0x32C9F2D: get_location_text (text-sink.cc:608)
==222835==    by 0x32C9F2D:
diagnostics::text_sink::build_prefix(diagnostics::diagnostic_info const&) const
(text-sink.cc:331)
==222835==    by 0x17DC154:
default_tree_diagnostic_text_starter(diagnostics::text_sink&,
diagnostics::diagnostic_info const*) (tree-diagnostic.cc:55)
==222835==    by 0x32C9C8B:
diagnostics::text_sink::on_report_diagnostic(diagnostics::diagnostic_info
const&, diagnostics::kind) (text-sink.cc:215)
==222835==    by 0x3294AD4:
diagnostics::context::report_diagnostic(diagnostics::diagnostic_info*)
(context.cc:1535)
==222835==    by 0x3295242:
diagnostics::context::diagnostic_impl(rich_location*, diagnostics::metadata
const*, diagnostics::option_id, char const*, __va_list_tag (*) [1],
diagnostics::kind) (context.cc:1689)
==222835==    by 0x3287E3A: pedwarn(unsigned long, diagnostics::option_id, char
const*, ...) (diagnostic-global-context.cc:442)
==222835==  Address 0x538c118 is 0 bytes after a block of size 8 alloc'd
==222835==    at 0x4BAC60F: operator new[](unsigned long)
(vg_replace_malloc.c:717)
==222835==    by 0x32A3D7C: diagnostics::file_cache::tune(unsigned long,
unsigned long) (file-cache.cc:208)
==222835==    by 0xF03FA6: toplev::main(int, char**) (toplev.cc:2359)
==222835==    by 0xF067FA: main (main.cc:39)
...

Reply via email to