[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
gcc-bugzilla@gcc.gnu.org
Fri Sep 2 18:56:35 GMT 2022
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.
More information about the Gcc-bugs
mailing list