https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127154
Bug ID: 127154
Summary: [17 Regression] valgrind "Conditional jump or move
depends on uninitialised value(s)" in
eq_p<generic_wide_int<wide_int_storage>, int>
(wide-int.h:2254)
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned 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 65459
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65459&action=edit
reduced testcase
In the past, this valgrind warning was followed by a SIGSEGV later; now, only
the warning about uninitialised use remains.
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c -wrapper
valgrind,-q,--track-origins=yes -c
==1338738== Conditional jump or move depends on uninitialised value(s)
==1338738== at 0x1B5CA9C: eq_p<generic_wide_int<wide_int_storage>, int>
(wide-int.h:2254)
==1338738== by 0x1B5CA9C: operator==<generic_wide_int<wide_int_storage>,
int> (wide-int.h:3852)
==1338738== by 0x1B5CA9C: unknown_p (value-range.h:196)
==1338738== by 0x1B5CA9C: prange_storage::set_prange(prange const&)
(value-range-storage.cc:713)
==1338738== by 0x1B5D496: prange_storage::alloc(vrange_internal_alloc&,
prange const&, bool) (value-range-storage.cc:631)
==1338738== by 0x1B5D978: vrange_allocator::clone_undefined(tree_node*)
(value-range-storage.cc:135)
==1338738== by 0x12E126B: sbr_vector::sbr_vector(tree_node*,
vrange_allocator*, bool) (gimple-range-cache.cc:116)
==1338738== by 0x12E2D0B: block_range_cache::set_bb_range(tree_node*,
basic_block_def const*, vrange const&) (gimple-range-cache.cc:421)
==1338738== by 0x12E4863: ranger_cache::register_inferred_value(vrange
const&, tree_node*, basic_block_def*) (gimple-range-cache.cc:1959)
==1338738== by 0x12E4ABD: ranger_cache::apply_inferred_ranges(gimple*)
(gimple-range-cache.cc:1994)
==1338738== by 0x1AEFCB5: rvrp_folder::fold_stmt(gimple_stmt_iterator*)
(tree-vrp.cc:1059)
==1338738== by 0x196F13E:
substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
(tree-ssa-propagate.cc:880)
==1338738== by 0x2E276BE: dom_walker::walk(basic_block_def*)
(domwalk.cc:311)
==1338738== by 0x196DE65:
substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
(tree-ssa-propagate.cc:1003)
==1338738== by 0x1AEAADD: execute_ranger_vrp(function*, bool)
(tree-vrp.cc:1086)
==1338738== Uninitialised value was created by a stack allocation
==1338738== at 0x1B5D8D0: vrange_allocator::clone_undefined(tree_node*)
(value-range-storage.cc:131)
==1338738==
$ 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-20260831065433-r17-3779-g09fe63bb71e6b1-checking-yes-rtl-df-extra-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
--enable-libsanitizer --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-20260831065433-r17-3779-g09fe63bb71e6b1-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260831 (experimental) (GCC)