I'm trying to discover which GCC optimization is responsive for a
runtime error reported by Valgrind:
"Conditional jump or move depends on uninitialised value(s)"
This pops up when compiling with -O1 and above. The code in question is
C++ and is of this form:
if (!foo&& !bar)
The uninitialized variable is 'bar'. However, it shouldn't be evaluated
at all due to short-circuit if rules. Of course the optimizer is free
to evaluate it anyway if there are no side-effects when doing so.
So just out of interest, I'm trying to find out which optimization is
responsible for this. I looked up the GCC info pages and I compiled
with -O1 and then disabled the optimizations enabled by -O1 one by one,
in hope to hit the one that triggers the error, until all of them were
disabled in the end:
[...]
However, the error still appears which makes me conclude that the above
list of -O1 optimizations is not complete. Which ones am I missing?