public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/98787] New: Aliasing not detected with array elements or some intents
@ 2021-01-22 8:44 jellby at yahoo dot com
2021-01-23 21:54 ` [Bug fortran/98787] " dominiq at lps dot ens.fr
0 siblings, 1 reply; 2+ messages in thread
From: jellby at yahoo dot com @ 2021-01-22 8:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98787
Bug ID: 98787
Summary: Aliasing not detected with array elements or some
intents
Product: gcc
Version: 10.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: jellby at yahoo dot com
Target Milestone: ---
With -Waliasing (or -Wall), passing the same array as two dummy arguments with
"intent(in)" and "intent(out)" is detected and warned about, but not when only
an array element (which may be the whole array with assumed size) is passed, or
when "intent(inout)" is used.
!==================================
program main
implicit none
real :: x(100)
integer :: i
do i=1,size(x)
x(i) = i
end do
! no warning for this:
call sub(size(x),x(1),x(1))
! warning for this:
call sub(size(x),x,x)
contains
subroutine sub(n,a,b)
implicit none
integer, intent(in) :: n
! no warning if one of these is inout:
real, intent(in) :: a(n)
real, intent(out) :: b(n)
b(:) = a(:)
end subroutine sub
end program main
!==================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-23 21:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 8:44 [Bug fortran/98787] New: Aliasing not detected with array elements or some intents jellby at yahoo dot com
2021-01-23 21:54 ` [Bug fortran/98787] " dominiq at lps dot ens.fr
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).