[Bug tree-optimization/92734] Missing match.pd simplification done by fold_binary_loc on generic
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Dec 3 12:12:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'm wondering if we shouldn't adjust also the
/* (A +- B) - A -> +- B */
/* (A +- B) -+ B -> A */
/* A - (A +- B) -> -+ B */
/* A +- (B -+ A) -> +- B */
patterns. Say testcases like:
int
f1 (int x, unsigned y)
{
return (int) (x + y) - x;
}
int
f2 (int x, unsigned y)
{
int a = x + y;
return a - x;
}
aren't really optimized ATM until combine. And they aren't really optimized
even with -fwrapv until combine, so the "turn on -fwrapv late in GIMPLE and
redoce a few optimizations" proposal wouldn't solve that.
More information about the Gcc-bugs
mailing list