Last week's valgrind build of trunk gcc, hash 97b56dece7413839, compiled ./gcc.c-torture/execute/pr60960.c fine. This week's valgrind build of trunk gcc, hash dc00689332f023d9 doesn't. This is what it does: ==471616== Conditional jump or move depends on uninitialised value(s) ==471616== at 0x15CF3B5: (anonymous namespace)::find_bswap_or_nop_finalize((anonymous namespace)::symbolic_number*, unsigned long*, unsigned long*) (gimple-ssa-store-merging.c:807) Source code gimple-ssa-store-merging.c:807 is if (n->base_addr) Flag -O2 used on source code file gcc.c-torture/execute/pr60960.c
git bisect in progress. Trying hash f23753c710d54fdf.
Looks good. Trying 0dd48296433763ba
Looks bad. Trying 571d3fb1f40fa85c
Looks bad. Trying 5137d1ae6a1fe4a3
I am struggling to make further progress with this one. Commit cd676dfa57e643a4f7d8445e6ebad0f21cf3fd84 looks suspicious, since it is the only one that changes anything in compiler source code file gimple-ssa-store-merging.c in the good .. bad range. Jakub, your best advice sought, please.
Testsuite file ./gcc.c-torture/execute/simd-6.c, with flag -O2, has similar problems with a valgrind version of gcc trunk.
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:9032d2b2414ed22e53a9980a51b835d3caf83c48 commit r11-6269-g9032d2b2414ed22e53a9980a51b835d3caf83c48 Author: Jakub Jelinek <jakub@redhat.com> Date: Sat Dec 19 12:46:40 2020 +0100 bswap: Fix up a thinko with empty CONSTRUCTORs [PR98378] The code I've added recently in find_bswap_or_nop for VECTOR CONSTRUCTORs is missing punt on an important case - namely empty CONSTRUCTORs, because in that case the loop will not initialize *n and the code after the loop will then use the uninitialized structure. 2020-12-19 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/98378 * gimple-ssa-store-merging.c (find_bswap_or_nop): Punt if CONSTRUCTOR has no elements.
I can provide, if requested, a list of other testsuite files that fail in the same way. This might be a good sanity check for Jakub's fix. Otherwise, I suggest that this bug could be marked as fixed.
.