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

--- Comment #14 from anlauf at gcc dot gnu.org ---
(In reply to anlauf from comment #12)
> Good point.  Tentative patch which excepts (d)conjg:
> 
> diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc
> index f8980754685..e1e4f1604cd 100644
> --- a/gcc/fortran/trans-types.cc
> +++ b/gcc/fortran/trans-types.cc
> @@ -3237,7 +3237,10 @@ gfc_return_by_reference (gfc_symbol * sym)
>    if (flag_f2c && sym->ts.type == BT_COMPLEX
>        && !sym->attr.pointer
>        && !sym->attr.allocatable
> -      && !sym->attr.intrinsic && !sym->attr.always_explicit)
> +      && (!sym->attr.intrinsic
> +       || strcmp (sym->name, "conjg") == 0
> +       || strcmp (sym->name, "dconjg") == 0)
> +      && !sym->attr.always_explicit)
>      return 1;
>  
>    return 0;

This fixes the reduced testcase for me, but gfortran.dg/specifics_1.f90
still fails here.

:-(

Reply via email to