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

            Bug ID: 124104
           Summary: [16 Regression] ICE: in fold_range, at range-op.cc:231
                    with -fanalyzer
           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 63673
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63673&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:8:13: internal compiler error: in fold_range, at range-op.cc:231
    8 |   return t ?: 5;
      |          ~~~^~~
0x2ca103d internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0xe2d841 fancy_abort(char const*, int, char const*)
        /repo/gcc-trunk/gcc/diagnostics/context.cc:1812
0x878a30 range_op_handler::fold_range(vrange&, tree_node*, vrange const&,
vrange const&, relation_trio) const
        /repo/gcc-trunk/gcc/range-op.cc:231
0x1b8ff41 ana::unaryop_svalue::maybe_get_value_range(value_range&) const
        /repo/gcc-trunk/gcc/analyzer/svalue.cc:1595
0x1b8fd24 ana::unaryop_svalue::maybe_get_value_range(value_range&) const
        /repo/gcc-trunk/gcc/analyzer/svalue.cc:1585
0x1b17e44 ana::region_model::eval_condition(ana::svalue const*, tree_code,
ana::svalue const*) const
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:5365
0x1b24cb6 ana::region_model::add_constraint(ana::svalue const*, tree_code,
ana::svalue const*, ana::region_model_context*)
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:5732
0x1b263ee ana::region_model::add_constraint(tree_node*, tree_code, tree_node*,
ana::region_model_context*, std::unique_ptr<ana::rejected_constraint,
std::default_delete<ana::rejected_constraint> >*)
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:5785
0x1afc46b ana::control_flow_op::execute(ana::operation_context&) const
        /repo/gcc-trunk/gcc/analyzer/ops.cc:1283
0x1ae046b ana::exploded_graph::process_node(ana::exploded_node*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3780
0x1ae0afa ana::exploded_graph::process_worklist()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3409
0x1ae357b ana::impl_run_checkers(ana::logger*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5269
0x1ae43a6 ana::run_checkers()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5360
0x1ad4d18 execute
        /repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:81
/repo/gcc-trunk/binary-trunk-20260214094811-r16-7512-g904b7a3010aaf2-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-20260214094811-r16-7512-g904b7a3010aaf2-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/ccu2Tvkp.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-20260214094811-r16-7512-g904b7a3010aaf2-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-20260214094811-r16-7512-g904b7a3010aaf2-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260214 (experimental) (GCC)

Reply via email to