https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105013
--- Comment #4 from James Allwright ---
I have re-run with the suggested options --track-origins=yes and -s :
$ valgrind --track-origins=yes -s ./bug
==16956== Memcheck, a memory error detector
==16956== Copyright (C) 2002-2017, and GNU GPL'd,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105013
--- Comment #2 from James Allwright ---
Here is the valgrind output
valgrind ./bug
==2490== Memcheck, a memory error detector
==2490== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2490== Using Valgrind-3.15.0 and LibVEX; re
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105013
Bug ID: 105013
Summary: Valgrind reports accessing uninitialized memory when
-O2 option is used
Product: gcc
Version: 9.4.0
Status: UNCONFIRMED
Severity: norma