>> an uninitialized y is an actual uninitialized register or memory location.
> On typical hardware, yes.
Maybe you can help me identify the register or memory location for y in your example: https://gcc.godbolt.org/z/3b4z56Y87
> On typical hardware, yes.
Maybe you can help me identify the register or memory location for y in your example: https://gcc.godbolt.org/z/3b4z56Y87
> Without Javascript the regular website is not functional. To go to the noscript version Compiler Explorer click here
"click here" goes to https://gcc.godbolt.org/noscript/z/3b4z56Y87, which has:
int choose(int cond1, int cond2)
{
int y;
int x1 = cond1 ? 2 : y; /* So int x1 = 2; */
int x2 = cond2 ? 3 : y; /* So int x2 = 3; */
return x1 + x2;
}
but no actual assembly.Based on context, I'll speculate that you have found a compiler bug, that the compiler writers will refuse to fix it, and that the varible y has been optimised out because it's unused after constant propagation, regardless of whether said compiler bug causes the constants being propagated to be incorrect.