From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F2A263858C27; Tue, 12 Oct 2021 15:00:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2A263858C27 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/102708] New: Improve ''array temporary was created for argument" diagnostic Date: Tue, 12 Oct 2021 15:00:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Tue, 12 Oct 2021 15:00:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102708 Bug ID: 102708 Summary: Improve ''array temporary was created for argument" diagnostic Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Target Milestone: --- The message is produced by gfc_conv_subref_array_arg when called with: if (fsym && proc_name) msg =3D xasprintf ("An array temporary was created for argument " "'%s' of procedure '%s'", fsym->name, proc_nam= e); else msg =3D xasprintf ("An array temporary was created"); obviously the message is clearer when fsym + proc_name is available. Howeve= r, in gfc_conv_procedure_call those aren't passed. Probably, it would be useful to have additionally the name of the calling procedure, e.g. "An array temporary was created in procedure '%s' for argument '%s' of procedure '%s'" Note: I also use it in my gfc_conv_gfc_desc_to_cfi_desc (submitted but unreviewed patch); thus that one should then also have the better diagnosti= c. (It already has the %s of proc %s diagnostic.)=