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

            Bug ID: 128177
           Summary: [17 Regression] valgrind error in
                    prange::set_pt_unknown() (value-range.h:1542)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

I just tried a valgrind build of today's gcc trunk. Configure line is

CFLAGS="-g1 -O0 -Wall -Wlogical-op" \
CXXFLAGS="-g1 -O0 -Wall -Wlogical-op" \
../trunk/configure --prefix=$HOME/gcc/results.$DATE.valgrind \
        --disable-bootstrap \
        --disable-doc \
        --disable-fixincludes \
        --disable-multilib \
        --with-pkgversion=$HASH \
        --enable-checking=valgrind \
        --enable-languages=c,c++,fortran

The build gets as far as building libgcc:

$ grep "^Config" mk.out 
Configuring in build-x86_64-pc-linux-gnu/libcpp
Configuring in ./lto-plugin
Configuring in ./libiberty
Configuring in build-x86_64-pc-linux-gnu/libiberty
Configuring in ./zlib
Configuring in ./libbacktrace
Configuring in ./libdecnumber
Configuring in ./libcody
Configuring in ./c++tools
Configuring in ./libcpp
Configuring in ./gcc
Configuring in ./libcc1
Configuring in x86_64-pc-linux-gnu/libgcc
$ 

Then this happens:

/home/dcb42/gcc/working/./gcc/xgcc -B/home/dcb42/gcc/working/./gcc/
-B/home/dcb42/gcc/results.20261026.valgrind/x86_64-pc-linux-gnu/bin/
-B/home/dcb42/gcc/results.20261026.valgrind/x86_64-pc-linux-gnu/lib/ -isystem
/home/dcb42/gcc/results.20261026.valgrind/x86_64-pc-linux-gnu/include -isystem
/home/dcb42/gcc/results.20261026.valgrind/x86_64-pc-linux-gnu/sys-include    -g
-O0 -g1 -O0 -Wall -Wlogical-op -O2  -g -O0 -g1 -O0 -Wall -Wlogical-op -DIN_GCC 
 -W -Wall -Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fpic
-mlong-double-80 -DUSE_ELF_SYMVER -fcf-protection -mshstk -g -DIN_LIBGCC2
-fbuilding-libgcc -fno-stack-protector  -fpic -mlong-double-80 -DUSE_ELF_SYMVER
-fcf-protection -mshstk -I. -I. -I../.././gcc -I../../../trunk/libgcc
-I../../../trunk/libgcc/. -I../../../trunk/libgcc/../gcc
-I../../../trunk/libgcc/../include -I../../../trunk/libgcc/config/i386
-I../../../trunk/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS
 -DUSE_TLS  -o _clear_cache_s.o -MT _clear_cache_s.o -MD -MP -MF
_clear_cache_s.dep -DSHARED -DL_clear_cache -c ../../../trunk/libgcc/libgcc2.c
==1121787== Conditional jump or move depends on uninitialised value(s)
==1121787==    at 0x4F567C: prange::set_pt_unknown() (value-range.h:1542)
==1121787==    by 0x1161ACD: prange::set(tree_node*,
generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage>
const&, value_range_kind) (value-range.cc:676)
==1121787==    by 0x116CB78: prange::prange(tree_node*,
generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage>
const&, value_range_kind) (value-range.h:1384)

This used to work last week. Despite putting -O0 in CFLAGS and
CXXFLAGS, libgcc can't be persuaded to avoid -O2.

Git hash for working is

$ ./results.20261020.valgrind/bin/gcc -v 2>&1 | grep exp
gcc version 17.0.0 20261019 (experimental) (708cc223b0f8b96c) 
gcc $ 

For broken:

trunk $ git rev-parse HEAD | cut -c1-16
58e696376aecf8b8
trunk $ 

This is 213 commits. Looking at the results for git blame 

64993a89ad75 (Aldy Hernandez    2024-03-20 06:25:52 +0100  674)   m_min = min;
64993a89ad75 (Aldy Hernandez    2024-03-20 06:25:52 +0100  675)   m_max = max;
8b45cd81fc35 (Andrew MacLeod    2026-06-10 13:42:27 -0400  676)  
set_pt_unknown ();
8b45cd81fc35 (Andrew MacLeod    2026-06-10 13:42:27 -0400  677)
64993a89ad75 (Aldy Hernandez    2024-03-20 06:25:52 +0100  678)   if (m_min ==
0 && m_max == -1)

Reply via email to