https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127181
Bug ID: 127181
Summary: [16/17 Regression] ICE: in maybe_get_value_range, at
analyzer/svalue.h:200 with -fanalyzer
Product: gcc
Version: 17.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 65473
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65473&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:2:1: internal compiler error: in maybe_get_value_range, at
analyzer/svalue.h:200
2 | void foo() { b -= (int)0x80000000; }
| ^~~~
0x2f0035d internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0xe598c5 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostics/context.cc:1813
0x97a60d ana::svalue::maybe_get_value_range(value_range&) const
/repo/gcc-trunk/gcc/analyzer/svalue.h:200
0x97a60d ana::svalue::maybe_get_value_range(value_range&) const
/repo/gcc-trunk/gcc/analyzer/svalue.h:196
0x97a60d ana::region_model::eval_condition(ana::svalue const*, tree_code,
ana::svalue const*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:5153
0x1b8d5cf ana::region_model::get_gassign_result(gassign const*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1232
0x1b90a5c ana::region_model::on_assignment(gassign const*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1623
0x1b6c72e ana::gimple_stmt_op::execute_on_state(ana::operation_context&,
ana::program_state) const
/repo/gcc-trunk/gcc/analyzer/ops.cc:447
0x1b6cb15 ana::gimple_stmt_op::execute(ana::operation_context&) const
/repo/gcc-trunk/gcc/analyzer/ops.cc:418
0x1b4a6eb ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:3519
0x1b4ad7a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3147
0x1b4d65b ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4846
0x1b4e486 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:4937
0x1b3fae8 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:81
/repo/gcc-trunk/binary-trunk-20260901180713-gac5f9f2a900-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-20260901180713-gac5f9f2a900-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -fanalyzer -o /tmp/cciTlnPf.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-20260901180713-gac5f9f2a900-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.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 --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-20260901180713-gac5f9f2a900-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260901 (experimental) (GCC)