https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104675
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|10.3.1, 11.2.1, 12.0, |
|6.5.0, 7.5.0, 8.5.0, 9.4.1 |
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It isn't just that match.pd change though, consider:
_Complex int foo (_Complex int a) { return (-1 + -1i) - a; }
_Complex int bar (_Complex int a) { return - a - (1 + 1i); }
_Complex int baz (_Complex int a) { _Complex int b = -1 + -1i; return b - a; }
_Complex int qux (_Complex int a) { _Complex int b = 1 + 1i; return - a - b; }
I think both:
/* -A - 1 -> ~A */
(simplify
(minus (convert? (negate @0)) integer_each_onep)
(if (!TYPE_OVERFLOW_TRAPS (type)
&& tree_nop_conversion_p (type, TREE_TYPE (@0)))
(bit_not (convert @0))))
/* -1 - A -> ~A */
(simplify
(minus integer_all_onesp @0)
(bit_not @0))
needs to punt for COMPLEX_TYPE.