From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7FB47385840F; Thu, 14 Oct 2021 09:49:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FB47385840F From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/102708] Improve ''array temporary was created for argument" diagnostic Date: Thu, 14 Oct 2021 09:49:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2021 09:49:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102708 --- Comment #1 from Tobias Burnus --- Actually, it prints the line number at the call site. Thus, there is probab= ly no need for adding the name of callee. However, related to the fsym/proc_name passing: Currently, the callers in gfc_conv_procedure_call do not make use of the avoid-copy-in feature by not passing the (add) contiguous (check) =3D true = flag to gfc_conv_subref_array_arg. There are some testcase which check that the copyin does not happen when be= ing contiguous, but I think those are not used for dummy arguments that are (CONTIGUOUS) assumed-shape/assumed-rank arrays. Side note: To get that working, it requires the gfc_conv_subref_array_arg changes of the patch at https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581575.html which might be the reason for not doing it currently. * * * Another observation, which might be unrelated or related: TRANSFORM can be implemented by just swapping the first and second dimension (see trans-intrinsic.s + trans-array.c, search for ISYM_TRANSFORM). Currently, GCC for a call makes it contiguous =E2=80=93 which it could be a= lso transferred as is (noncontiguous). I am not sure what's better, though. Testcase: gfortran.dg/c-interop/fc-descriptor-7.f90 also part of the patch= =20 https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581575.html Search for the comments regarding the implementation choice. As testing shows, calling a Fortran procedure does the copy in (as mentione= d) but with my patch, calling a BIND(C) procedure passes the array as noncontiguous array. Thus, I wonder whether it is also related to the gfc_conv_subref_array_arg. * * * gfc_conv_subref_array_arg: While the above mentioned patch adds support for= a contiguous check with descriptors, I lack an optional + contiguous check testcase. However, that can only be added once gfc_conv_subref_array_arg is called wi= th contiguous=3Dtrue - or in any other way with type =3D descriptor type.=