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

--- Comment #16 from anlauf at gcc dot gnu.org ---
(In reply to Andrew Pinski from comment #15)
> (In reply to anlauf from comment #14)
> > This fixes the reduced testcase for me, but gfortran.dg/specifics_1.f90
> > still fails here.
> 
> Which means there are many more intrinsics here that need this treatment.
> The testcase has just subroutine test_* calls in the "program" (main) in it
> which you can narrow down which ones are failing ones are failing.

The following works:

diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc
index f8980754685..eb45abe97d5 100644
--- a/gcc/fortran/trans-types.cc
+++ b/gcc/fortran/trans-types.cc
@@ -3237,7 +3237,7 @@ 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.always_explicit)
     return 1;

   return 0;


I wonder whether the 20 year old comment before this block was ever correct.

Reply via email to