https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120099
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to anlauf from comment #10) > (In reply to Andrew Pinski from comment #9) > > Can't be done for the f2c functions. > > libgfortran/intrinsics/f2c_specifics.F90 has: > > subroutine _gfortran_f2c_specific__conjg_4 (res, parm) > COMPLEX, intent (in) :: parm > COMPLEX, intent (out) :: res > res = conjg (parm) > end subroutine > > So this is actually really a pure subroutine with no side-effects in the > fortran sense (the normal non-f2c counterpart is a pure elemental function). > 'parm' is input, 'res' is output. > > What is the expected way to do this? It might be pure in the fortran sense but it is not pure in the GCC IR sense since it stores to the first argument. I wonder why gfc_return_by_reference is not returning true here because I think that would be idea here.