https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790
--- Comment #6 from Pierre-Marie de Rodat <derodat at adacore dot com> --- Thanks for your answer, Richard! (In reply to Richard Biener from comment #5) > So what is the issue with replacing zero-extending an uninitialized %ebp > with a random other value? Both are essentially undefined when reached via > the somlabel bypass. Well, at least on x86, even when %ebp is uninitialized, “movzwl %bp, %ebp” makes its upper half zero (and yes, the lower half is uninitialized). Hence a following “shr $0x10, %ebp” is supposed to leave zero in %epb, for instance. If we have a random value instead as shr’s input, this does not work anymore, so I consider this transformation is an error. > Is the real issue happening in a downstream pass? I don't think REE does > anything wrong here. REE is the pass where I observed the change in behavior I described in my first message, and I did not notice anything weird beyond this. If the above is wrong (i.e. if we cannot assume (zext UNDEF from i16 to i32) >> 16 == 0), then I guess I’ll have to look for something wrong up in the pipe. ;-)