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

            Bug ID: 113999
           Summary: [14 Regression] ICE: in
                    string_cst_has_null_terminator, at
                    analyzer/region-model.cc:3651 with -fanalyzer on
                    gcc.dg/tree-ssa/strncpy-2.c
           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 57464
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57464&action=edit
auto-reduced testcase

Maybe related to PR113998

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer gcc.dg/tree-ssa/strncpy-2.c
during IPA pass: analyzer
gcc.dg/tree-ssa/strncpy-2.c: In function 'main':
gcc.dg/tree-ssa/strncpy-2.c:24:15: internal compiler error: in
string_cst_has_null_terminator, at analyzer/region-model.cc:3651
   24 |   size_t n1 = __builtin_strlen (a);
      |               ^~~~~~~~~~~~~~~~~~~~
0x8c3351 string_cst_has_null_terminator
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:3651
0x195c069 svalue_byte_range_has_null_terminator_1
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:3712
0x195c069 svalue_byte_range_has_null_terminator
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:3809
0x195c3c8 svalue_byte_range_has_null_terminator_1
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:3774
0x195c3c8 svalue_byte_range_has_null_terminator
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:3809
0x1969838 ana::region_model::scan_for_null_terminator_1(ana::region const*,
tree_node*, ana::svalue const**, ana::region_model_context*) const
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:4066
0x196a67e
ana::region_model::check_for_null_terminated_string_arg(ana::call_details
const&, unsigned int, bool, ana::svalue const**) const
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:4337
0x1945766 ana::kf_strlen::impl_call_pre(ana::call_details const&) const
        /repo/gcc-trunk/gcc/analyzer/kf.cc:1389
0x1961a57 ana::region_model::on_call_pre(gcall const*,
ana::region_model_context*)
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:1700
0x196600a ana::region_model::on_stmt_pre(gimple const*, bool*,
ana::region_model_context*)
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:1337
0x192cf70 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*, bool*,
ana::path_context*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:1512
0x192ff05 ana::exploded_graph::process_node(ana::exploded_node*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:4124
0x1930e3a ana::exploded_graph::process_worklist()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3515
0x19335a3 ana::impl_run_checkers(ana::logger*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:6209
0x19344b6 ana::run_checkers()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x1922e58 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-9062-20240219114159-geb17bdc211a-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-9062-20240219114159-geb17bdc211a-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240219 (experimental) (GCC)

Reply via email to