https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110410
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jw Zeng from comment #3) > (In reply to Richard Biener from comment #2) > > phi-opt again? > > Link to the Compiler Explorer:https://godbolt.org/z/EeEqMGnWo > > I reduced the code again, I hope it helps. The reduced code is as follows: This reduced testcase is the same issue except it is dom2 which has the missed optimization: Exported global range table: ============================ _3 : [irange] int [0, 65535] NONZERO 0xffff _7 : [irange] int [0, 65535] NONZERO 0xffff iftmp.0_16 : [irange] unsigned int [0, 1][2147483648, +INF] iftmp.7_21 : [irange] unsigned int [0, 0][2147483648, +INF] iftmp.7_22 : [irange] unsigned int [0, 0] NONZERO 0x0 Note the reason why dom3 is able to figure out: # VUSE <.MEM_18(D)> var_3.9_9 = var_3; is the same as var_3.3_2 and not fre3 is because a jump threading is needed to happen before. Once dom3 is already to figure that out, it becomes obvious that is _22 is 0 and such.