public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95718] New: Wrong pointer associated status without initialization
@ 2020-06-17 9:04 peng.wang@compiler-dev.com
2020-06-17 10:12 ` [Bug fortran/95718] [8/9/10/11 Regression] " dominiq at lps dot ens.fr
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: peng.wang@compiler-dev.com @ 2020-06-17 9:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95718
Bug ID: 95718
Summary: Wrong pointer associated status without initialization
Product: gcc
Version: 10.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: peng.wang@compiler-dev.com
Target Milestone: ---
consider the code below:
****
program test
integer,pointer::ptr
integer,pointer::ptr1
integer,pointer::ptr2
integer,pointer::ptr3
integer,pointer::ptr4
print*,associated(ptr),'associated(ptr)'
print*,associated(ptr1),'associated(ptr1)'
print*,associated(ptr2),'associated(ptr2)'
print*,associated(ptr3),'associated(ptr3)'
print*,associated(ptr4),'associated(ptr4)'
end program test
****
#gfortran -std=f2008 test.f90 ; ./a.out
T associated(ptr)
F associated(ptr1)
T associated(ptr2)
F associated(ptr3)
T associated(ptr4)
the associated status of the pointers is uncertain after the execution above.
according to F2008 draft 16.5.2.7, the associated status of the pointer should
be F in the case above.
this is the options given when GCC was configured:
# gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gcc/libexec/gcc/x86_64-pc-linux-gnu/10.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/usr/local/gcc -enable-checking=release
-enable-languages=c,fortran -disable-bootstrap -disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.1.0 (GCC)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/95718] [8/9/10/11 Regression] Wrong pointer associated status without initialization
2020-06-17 9:04 [Bug fortran/95718] New: Wrong pointer associated status without initialization peng.wang@compiler-dev.com
@ 2020-06-17 10:12 ` dominiq at lps dot ens.fr
2020-06-17 10:44 ` dominiq at lps dot ens.fr
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-06-17 10:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95718
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |10.1.0, 11.0, 6.5.0, 7.4.0,
| |8.3.0, 9.2.0
Priority|P3 |P4
Ever confirmed|0 |1
Keywords| |wrong-code
Target Milestone|--- |8.4
Last reconfirmed| |2020-06-17
Status|UNCONFIRMED |NEW
Summary|Wrong pointer associated |[8/9/10/11 Regression]
|status without |Wrong pointer associated
|initialization |status without
| |initialization
Known to work| |5.5.0
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
GCC5.5.0 gives
F associated(ptr)
F associated(ptr1)
F associated(ptr2)
F associated(ptr3)
F associated(ptr4)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/95718] [8/9/10/11 Regression] Wrong pointer associated status without initialization
2020-06-17 9:04 [Bug fortran/95718] New: Wrong pointer associated status without initialization peng.wang@compiler-dev.com
2020-06-17 10:12 ` [Bug fortran/95718] [8/9/10/11 Regression] " dominiq at lps dot ens.fr
@ 2020-06-17 10:44 ` dominiq at lps dot ens.fr
2020-06-17 15:52 ` kargl at gcc dot gnu.org
2020-07-23 7:29 ` peng.wang@compiler-dev.com
3 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-06-17 10:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95718
--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The change occurred between revisions r226476 (2015-08-02, OK) and r227252
(2015-08-27, wrong). No idea about how this translates to git!-(
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/95718] [8/9/10/11 Regression] Wrong pointer associated status without initialization
2020-06-17 9:04 [Bug fortran/95718] New: Wrong pointer associated status without initialization peng.wang@compiler-dev.com
2020-06-17 10:12 ` [Bug fortran/95718] [8/9/10/11 Regression] " dominiq at lps dot ens.fr
2020-06-17 10:44 ` dominiq at lps dot ens.fr
@ 2020-06-17 15:52 ` kargl at gcc dot gnu.org
2020-07-23 7:29 ` peng.wang@compiler-dev.com
3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-06-17 15:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95718
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
CC| |kargl at gcc dot gnu.org
--- Comment #3 from kargl at gcc dot gnu.org ---
16.5.2.2 Pointer association status
A pointer may have a pointer association status of associated,
disassociated, or undefined. Its association status may change
during execution of a program. Unless a pointer is initialized
(explicitly or by default), it has an initial association status
of undefined. A pointer may be initialized to have an association
status of disassociated or associated.
13.7.16 ASSOCIATED (POINTER [, TARGET])
POINTER shall be a pointer. It may be of any type or may be a
procedure pointer. Its pointer association status shall not
be undefined.
Your program is invalid.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/95718] [8/9/10/11 Regression] Wrong pointer associated status without initialization
2020-06-17 9:04 [Bug fortran/95718] New: Wrong pointer associated status without initialization peng.wang@compiler-dev.com
` (2 preceding siblings ...)
2020-06-17 15:52 ` kargl at gcc dot gnu.org
@ 2020-07-23 7:29 ` peng.wang@compiler-dev.com
3 siblings, 0 replies; 5+ messages in thread
From: peng.wang@compiler-dev.com @ 2020-07-23 7:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95718
--- Comment #4 from PengWang <peng.wang@compiler-dev.com> ---
(In reply to kargl from comment #3)
> 16.5.2.2 Pointer association status
>
> A pointer may have a pointer association status of associated,
> disassociated, or undefined. Its association status may change
> during execution of a program. Unless a pointer is initialized
> (explicitly or by default), it has an initial association status
> of undefined. A pointer may be initialized to have an association
> status of disassociated or associated.
>
> 13.7.16 ASSOCIATED (POINTER [, TARGET])
>
> POINTER shall be a pointer. It may be of any type or may be a
> procedure pointer. Its pointer association status shall not
> be undefined.
>
> Your program is invalid.
thank you very much! The status of undefined has confused me for a long time,
now I understand it finally, thank you~
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-07-23 7:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17 9:04 [Bug fortran/95718] New: Wrong pointer associated status without initialization peng.wang@compiler-dev.com
2020-06-17 10:12 ` [Bug fortran/95718] [8/9/10/11 Regression] " dominiq at lps dot ens.fr
2020-06-17 10:44 ` dominiq at lps dot ens.fr
2020-06-17 15:52 ` kargl at gcc dot gnu.org
2020-07-23 7:29 ` peng.wang@compiler-dev.com
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).