https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108878

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
For the specific testcase I also wonder if the Fortran frontend optimization
pass can somehow unify these?

But yes, to be able to optimize these kind of library functions we need an
internal representation that doesn't involve memory.  An internal function
with a _Complex integer return value should do.  I think it's better to
V_C_E from integer to float, and to truncate from long int to int for
frexp[l].  That avoids oddities with XFmode but we have to choose
int128_t there which makes it difficult for 32bit x86 abd frexpl.

In the end we'd like to support multiple return values in a nicer way,
the least invasive might be using a structure type specially marked as
register type that we'd write into SSA and never support partially
altering (or even constructing by sth else than calls).  But then a
'pair' of SSA names via a special type kind that just does composition
but no layouting would be a nicer way.

Reply via email to