public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "darmar.xxl at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51435] New: Bad association status after null() of derived type component Date: Tue, 06 Dec 2011 09:29:00 -0000 [thread overview] Message-ID: <bug-51435-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51435 Bug #: 51435 Summary: Bad association status after null() of derived type component Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: darmar.xxl@gmail.com Created attachment 26002 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26002 test code Here is the code: !--------------- module arr_m type arr_t real(8), dimension(:), allocatable :: rsk ! if allocatable changed to pointer, all is OK end type end module arr_m !********************* module list_m use arr_m implicit none type my_list type(arr_t), pointer :: head => null() !!!integer, pointer :: tail => null() !if this is uncommented, all is OK. end type my_list end module list_m !*********************** module worker_mod use list_m implicit none type data_all_t type(my_list) :: my_data end type data_all_t contains subroutine do_job() type(data_all_t) :: dum if (associated(dum%my_data%head)) then print *, 'do_job my_data%head is associated' ! ! gfortran goes here. ! WRONG. head was nullified. ! else print *, 'do_job my_data%head is NOT associated' ! OK end if end subroutine end module !*************** program hello use worker_mod implicit none call do_job() end program !*************** gfortran reports that dum%my_data%head is associated in the sub "do_job", while "head" component was nullified using null() in the variable declaration line. I tested this with gfortran 4.6 and 4.7 on Linux and Windows (produces wrong results). Version 4.5 outputs correct result. (ifort is OK).
next reply other threads:[~2011-12-06 9:29 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-12-06 9:29 darmar.xxl at gmail dot com [this message] 2011-12-06 10:08 ` [Bug fortran/51435] [4.6/4.7 Regression] " burnus at gcc dot gnu.org 2011-12-06 10:34 ` burnus at gcc dot gnu.org 2011-12-06 13:08 ` jakub at gcc dot gnu.org 2011-12-06 14:01 ` dominiq at lps dot ens.fr 2011-12-06 18:10 ` burnus at gcc dot gnu.org 2011-12-06 19:27 ` burnus at gcc dot gnu.org 2011-12-06 19:30 ` burnus at gcc dot gnu.org 2011-12-20 18:06 ` burnus 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-51435-4@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: linkBe 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).