public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/106817] New: clobber ordering problem when an actual intent(in) argument depends on the value of an intent(out) argument
@ 2022-09-02 18:56 mikael at gcc dot gnu.org
  2022-09-02 18:59 ` [Bug fortran/106817] " mikael at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: mikael at gcc dot gnu.org @ 2022-09-02 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106817
           Summary: clobber ordering problem when an actual intent(in)
                    argument depends on the value of an intent(out)
                    argument
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikael at gcc dot gnu.org
  Target Milestone: ---

module m
  implicit none
contains
  subroutine copy(in, out)
    integer, intent(in) :: in
    integer, intent(out) :: out
    out = in
  end subroutine copy
end module m

program p
  use m
  implicit none
  integer :: a
  a = 3
  call copy(a+1, a)
  if (a /= 4) stop 1
end program p


The in value (a+1) depends on the value of a, but a is clobbered at the
beginning of the call to copy, so we should make sure that we have evaluated
a+1 before generating the clobber.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-10-12 12:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02 18:56 [Bug fortran/106817] New: clobber ordering problem when an actual intent(in) argument depends on the value of an intent(out) argument 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
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

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).