https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68021
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #11) > void bar (void); > > void > foo (int p2, int p3) > { > unsigned long a = p2; > unsigned long b = (~(unsigned long) ((unsigned int) p3 + -1U)) + a; > unsigned long c = (a - (unsigned long) ((unsigned int) p3 + -1U)) + (-1UL); > if (b != c) > bar (); > } > > shows this folding inconsistency in the *.original dump: > long unsigned int a = (long unsigned int) p2; > long unsigned int b = (a - (long unsigned int) ((unsigned int) p3 + > 4294967295)) - 1; > long unsigned int c = (a - (long unsigned int) ((unsigned int) p3 + > 4294967295)) + 18446744073709551615; > but *.gimple already canonicalizes it, so that it does + > 18446744073709551615 at the end in both cases. associate_trees doesn't re-fold the result (due to fear of recursion I guess)