https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
--- Comment #9 from Jakub Jelinek ---
Author: jakub
Date: Wed Dec 4 09:38:48 2019
New Revision: 278958
URL: https://gcc.gnu.org/viewcvs?rev=278958&root=gcc&view=rev
Log:
PR tree-optimization/92734
* match.pd ((A +- B) - A -> +-
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
--- Comment #8 from Jakub Jelinek ---
Created attachment 47406
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47406&action=edit
gcc10-pr92734-2.patch
Untested patch that implements that.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
--- Comment #7 from Jakub Jelinek ---
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 testcas
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
Richard Biener changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
--- Comment #5 from Jakub Jelinek ---
Author: jakub
Date: Tue Dec 3 09:20:43 2019
New Revision: 278925
URL: https://gcc.gnu.org/viewcvs?rev=278925&root=gcc&view=rev
Log:
PR tree-optimization/92734
* match.pd ((CST1 - A) +- CST2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
Jakub Jelinek changed:
What|Removed |Added
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
--- Comment #3 from Jakub Jelinek ---
The (A +- CST1) +- CST2 -> A + CST3 pattern already does handle casts it seems,
it is just the other two that don't.
That has been added in r249447 with a follow-up fix in r257683.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
--- Comment #2 from Richard Biener ---
We have a set of special-case patterns for simple associations in match.pd, one
for this case seems missing, like the group
/* Match patterns that allow contracting a plus-minus pair
irrespective of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
--- Comment #1 from Jakub Jelinek ---
Of course we have reassoc, but in there we punt on the non-wrapping integral
types, because reassociation is generally unsafe for them. There are just
special cases that can be handled.