https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120331
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> Created attachment 61460 [details]
> Patch which I am testing
It has one regression though: gcc.dg/builtins-61.c .
That is due to this pattern:
/* cexp(x+yi) -> exp(x)*cexpi(y). */
(for cexps (CEXP)
exps (EXP)
cexpis (CEXPI)
(simplify
(cexps compositional_complex@0)
(if (targetm.libc_has_function (function_c99_math_complex, TREE_TYPE (@0)))
(complex
(mult (exps@1 (realpart @0)) (realpart (cexpis:type@2 (imagpart @0))))
(mult @1 (imagpart @2)))))))
I didn't realize you could capture part of the result and reuse that. That
might be the only pattern which does that.
I guess I need to rethink where to place this part.