https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108357
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Xi Ruoyao from comment #7) > (In reply to Richard Biener from comment #6) > > (In reply to Xi Ruoyao from comment #5) > > > The test fails on loongarch64-linux-gnu. foo is kept in 114t.threadfull1, > > > but removed in 135t.forwprop3. > > > > > > Does this mean something is wrong for LoongArch, or we should simply check > > > the tree dump in a later pass (for e.g. 254t.optimized)? > > > > I guess it depends on LOGICAL_OP_NON_SHORT_CIRCUIT, can you try > > --param logical-op-non-short-circuit=1 and see if that helps? > > Nope, the result is same. Aha, the issue is missing promotions, already in .original: - short int g = a (5, (int) ((short int) b ^ 9854)); - f ((int) g); + short int g = a (5, (short int) b ^ 9854); + f (g); (+ is loongarch, - is x86_64) That results in different IL into threadfull1. On loongarch forwprop3 elides the branch, probably with the help of nonzero bits set by CCP.