public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/106817] clobber ordering problem when an actual intent(in) argument depends on the value of an intent(out) argument
Date: Sun, 25 Sep 2022 12:48:06 +0000	[thread overview]
Message-ID: <bug-106817-4-jsxx60C0sf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106817-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Mikael Morin <mikael@gcc.gnu.org>:

https://gcc.gnu.org/g:29919bf3b6449bafd02e795abbb1966e3990c1fc

commit r13-2835-g29919bf3b6449bafd02e795abbb1966e3990c1fc
Author: Mikael Morin <mikael@gcc.gnu.org>
Date:   Sat Sep 3 11:58:47 2022 +0200

    fortran: Move clobbers after evaluation of all arguments [PR106817]

    For actual arguments whose dummy is INTENT(OUT), we used to generate
    clobbers on them at the same time we generated the argument reference
    for the function call.  This was wrong if for an argument coming
    later, the value expression was depending on the value of the just-
    clobbered argument, and we passed an undefined value in that case.

    With this change, clobbers are collected separatedly and appended
    to the procedure call preliminary code after all the arguments have been
    evaluated.

            PR fortran/106817

    gcc/fortran/ChangeLog:

            * trans-expr.cc (gfc_conv_procedure_call): Collect all clobbers
            to their own separate block.  Append the block of clobbers to
            the procedure preliminary block after the argument evaluation
            codes for all the arguments.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/intent_optimize_4.f90: New test.

  parent reply	other threads:[~2022-09-25 12:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02 18:56 [Bug fortran/106817] New: " mikael at gcc dot gnu.org
2022-09-02 18:59 ` [Bug fortran/106817] " mikael at gcc dot gnu.org
2022-09-02 19:56 ` anlauf at gcc dot gnu.org
2022-09-02 20:06 ` mikael at gcc dot gnu.org
2022-09-02 20:09 ` mikael at gcc dot gnu.org
2022-09-02 20:17 ` anlauf at gcc dot gnu.org
2022-09-03  9:28 ` mikael at gcc dot gnu.org
2022-09-25 12:48 ` cvs-commit at gcc dot gnu.org [this message]
2022-10-10 20:05 ` cvs-commit at gcc dot gnu.org
2022-10-10 20:53 ` cvs-commit at gcc dot gnu.org
2022-10-12 12:34 ` cvs-commit at gcc dot gnu.org
2022-10-12 12:37 ` mikael at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106817-4-jsxx60C0sf@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).