https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111361
Bug ID: 111361 Summary: [14 Regression] ICE: in has_null_terminator, at analyzer/region-model.cc:3410 with -fanalyzer Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Created attachment 55870 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55870&action=edit reduced testcase Compiler output: $ x86_64-pc-linux-gnu-gcc -fanalyzer testcase.c during IPA pass: analyzer testcase.c: In function 'foo': testcase.c:7:3: internal compiler error: in has_null_terminator, at analyzer/region-model.cc:3410 7 | __builtin_strncpy (out, (void *)&v, 5); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0x18a4beb ana::fragment::has_null_terminator(generic_wide_int<fixed_wide_int_storage<128> >, generic_wide_int<fixed_wide_int_storage<128> >*) const /repo/gcc-trunk/gcc/analyzer/region-model.cc:3410 0x1893cf5 ana::region_model::scan_for_null_terminator(ana::region const*, tree_node*, ana::svalue const**, ana::region_model_context*) const /repo/gcc-trunk/gcc/analyzer/region-model.cc:3676 0x18740c3 ana::kf_strncpy::impl_call_post(ana::call_details const&) const /repo/gcc-trunk/gcc/analyzer/kf.cc:1544 0x18740c3 ana::kf_strncpy::impl_call_post(ana::call_details const&) const /repo/gcc-trunk/gcc/analyzer/kf.cc:1409 0x189f197 ana::region_model::on_call_post(gcall const*, bool, ana::region_model_context*) /repo/gcc-trunk/gcc/analyzer/region-model.cc:1679 0x186137b ana::exploded_node::on_stmt_post(gimple const*, ana::program_state*, bool, ana::region_model_context*) /repo/gcc-trunk/gcc/analyzer/engine.cc:1569 0x186137b ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode const*, gimple const*, ana::program_state*, ana::uncertainty_t*, ana::path_context*) /repo/gcc-trunk/gcc/analyzer/engine.cc:1507 0x1863e25 ana::exploded_graph::process_node(ana::exploded_node*) /repo/gcc-trunk/gcc/analyzer/engine.cc:4082 0x1864d6a ana::exploded_graph::process_worklist() /repo/gcc-trunk/gcc/analyzer/engine.cc:3476 0x186745f ana::impl_run_checkers(ana::logger*) /repo/gcc-trunk/gcc/analyzer/engine.cc:6144 0x18682e6 ana::run_checkers() /repo/gcc-trunk/gcc/analyzer/engine.cc:6232 0x1857608 execute /repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87 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. $ x86_64-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-3825-20230910101237-g0d50facd937-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --disable-bootstrap --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r14-3825-20230910101237-g0d50facd937-checking-yes-rtl-df-extra-nobootstrap-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.0 20230910 (experimental) (GCC)