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

            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 = xasprintf ("An array temporary was created for argument "
                             "'%s' of procedure '%s'", fsym->name, proc_name);
      else
        msg = xasprintf ("An array temporary was created");

obviously the message is clearer when fsym + proc_name is available. However,
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 diagnostic.
(It already has the %s of proc %s diagnostic.)

Reply via email to