https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109626
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We apply from match.pd (-A) * (-B) -> A * B and -(A - B) -> B - A where
there are no constraints on overflow present for these patterns.
We go
(int) (v2_6(D) - _2) * (int) - v1_5(D)
-> (int) (- (v2_6(D) - _2)) * (int) v1_5(D)
-> (int) (_2 - v2_6(D)) * (int) v1_5(D)
I think the issue must be in (-A) * (-B) -> A * B, but I can't quite nail it.
To result in -1 * INT_MIN we'd have to come from 1 * INT_MIN but then the
negation of INT_MIN would already be problematic.