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

            Bug ID: 124195
           Summary: [16 Regression] ICE: in type, at value-range.h:1004
                    with -fanalyzer and division by zero
           Product: gcc
           Version: 16.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 63742
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63742&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:12: internal compiler error: in type, at value-range.h:1004
    7 |   return s > 0;
      |          ~~^~~
0x2ca34bd internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0xe2d1b7 fancy_abort(char const*, int, char const*)
        /repo/gcc-trunk/gcc/diagnostics/context.cc:1812
0x778cf2 irange::type() const
        /repo/gcc-trunk/gcc/value-range.h:1004
0xefee30 irange::type() const
        /repo/gcc-trunk/gcc/value-range.h:1003
0x1b8f9c5 value_range::type()
        /repo/gcc-trunk/gcc/value-range.h:797
0x1b8f9c5 ana::unaryop_svalue::maybe_get_value_range(value_range&) const
        /repo/gcc-trunk/gcc/analyzer/svalue.cc:1589
0x1b17a84 ana::region_model::eval_condition(ana::svalue const*, tree_code,
ana::svalue const*) const
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:5365
0x1b1e4ef ana::region_model::get_gassign_result(gassign const*,
ana::region_model_context*)
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:1287
0x1b2145c ana::region_model::on_assignment(gassign const*,
ana::region_model_context*)
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:1642
0x1afdf8e ana::gimple_stmt_op::execute_on_state(ana::operation_context&,
ana::program_state) const
        /repo/gcc-trunk/gcc/analyzer/ops.cc:378
0x1afe375 ana::gimple_stmt_op::execute(ana::operation_context&) const
        /repo/gcc-trunk/gcc/analyzer/ops.cc:349
0x1ae00cb ana::exploded_graph::process_node(ana::exploded_node*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3783
0x1ae075a ana::exploded_graph::process_worklist()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3412
0x1ae31bb ana::impl_run_checkers(ana::logger*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5272
0x1ae3fe6 ana::run_checkers()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5363
0x1ad4958 execute
        /repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:81
/repo/gcc-trunk/binary-trunk-20260220205235-r16-7605-gb47dbeb3223468-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.1/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-20260220205235-r16-7605-gb47dbeb3223468-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../lib/gcc/x86_64-pc-linux-gnu/16.0.1/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -fanalyzer -o /tmp/ccCLEg8F.s
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-20260220205235-r16-7605-gb47dbeb3223468-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.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
--disable-bootstrap --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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20260220205235-r16-7605-gb47dbeb3223468-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260220 (experimental) (GCC)

Reply via email to