public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51639] New: Nested type pointer null initialisation fails
@ 2011-12-20 16:28 jonathan.hogg at stfc dot ac.uk
  2011-12-20 16:45 ` [Bug fortran/51639] " dominiq at lps dot ens.fr
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jonathan.hogg at stfc dot ac.uk @ 2011-12-20 16:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51639

             Bug #: 51639
           Summary: Nested type pointer null initialisation fails
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jonathan.hogg@stfc.ac.uk


The following code appears to produce a regression in 4.6:

program main
   implicit none

   type type1
      integer, dimension(:), allocatable :: member
   end type type1

   type type2
      type(type1), pointer :: t1ptr=>null()
   end type type2

   call test
contains

subroutine test
   type(type2) :: t2

   print *, "associated(t2%t1ptr) = ", associated(t2%t1ptr)

end subroutine test

end program

Produces the output
  associated(t2%t1ptr) =  T

but should produce the output
  associated(t2%t1ptr) =  F

Further valgrind shows that access is to an uninitialised pointer.

The code works as expected under 4.4.6 and 4.5.4.

To provoke the error it seems that the associated() check must occur within a
subroutine, and that type1 must have an allocatable component.

Thanks,

Jonathan.


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

* [Bug fortran/51639] Nested type pointer null initialisation fails
  2011-12-20 16:28 [Bug fortran/51639] New: Nested type pointer null initialisation fails jonathan.hogg at stfc dot ac.uk
@ 2011-12-20 16:45 ` dominiq at lps dot ens.fr
  2011-12-20 16:56 ` [Bug fortran/51639] [4.6 Regression] " burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-12-20 16:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51639

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-12-20 16:27:46 UTC ---
This seems to have been fixed on trunk between revisions 181881 (valgrind
error) and 182076 (OK).


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

* [Bug fortran/51639] [4.6 Regression] Nested type pointer null initialisation fails
  2011-12-20 16:28 [Bug fortran/51639] New: Nested type pointer null initialisation fails jonathan.hogg at stfc dot ac.uk
  2011-12-20 16:45 ` [Bug fortran/51639] " dominiq at lps dot ens.fr
@ 2011-12-20 16:56 ` burnus at gcc dot gnu.org
  2011-12-20 17:21 ` dominiq at lps dot ens.fr
  2011-12-20 17:45 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-20 16:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51639

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org
   Target Milestone|---                         |4.6.3
            Summary|Nested type pointer null    |[4.6 Regression] Nested
                   |initialisation fails        |type pointer null
                   |                            |initialisation fails


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

* [Bug fortran/51639] [4.6 Regression] Nested type pointer null initialisation fails
  2011-12-20 16:28 [Bug fortran/51639] New: Nested type pointer null initialisation fails jonathan.hogg at stfc dot ac.uk
  2011-12-20 16:45 ` [Bug fortran/51639] " dominiq at lps dot ens.fr
  2011-12-20 16:56 ` [Bug fortran/51639] [4.6 Regression] " burnus at gcc dot gnu.org
@ 2011-12-20 17:21 ` dominiq at lps dot ens.fr
  2011-12-20 17:45 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-12-20 17:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51639

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-12-20 17:13:31 UTC ---
Tobias,

Do you have a 4.6.3 build after r182062 (p51435)? If yes, could you check its
behavior for this pr? TIA.


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

* [Bug fortran/51639] [4.6 Regression] Nested type pointer null initialisation fails
  2011-12-20 16:28 [Bug fortran/51639] New: Nested type pointer null initialisation fails jonathan.hogg at stfc dot ac.uk
                   ` (2 preceding siblings ...)
  2011-12-20 17:21 ` dominiq at lps dot ens.fr
@ 2011-12-20 17:45 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-20 17:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51639

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-20 17:43:43 UTC ---
(In reply to comment #2)
> Do you have a 4.6.3 build after r182062 (p51435)? If yes, could you check its
> behavior for this pr? TIA.

I have a 4.6 build from Dec 11, which should be after Rev. 182062. There, I do
not see any valgrind error (contrary to the 4.6.2 release version). Seems to be
indeed a duplicate of PR 51435.


Jonathan: Could you try with a newer GCC - either GCC 4.6.3 (newer than
2011-12-06), or GCC 4.7 (experimental) [newer than 2011-12-06]. You could also
try an older version, GCC 4.5 is not affected.
Links to unofficial binaries and to instructions for building from source:
http://gcc.gnu.org/wiki/GFortranBinaries

*** This bug has been marked as a duplicate of bug 51435 ***


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

end of thread, other threads:[~2011-12-20 17:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-20 16:28 [Bug fortran/51639] New: Nested type pointer null initialisation fails jonathan.hogg at stfc dot ac.uk
2011-12-20 16:45 ` [Bug fortran/51639] " dominiq at lps dot ens.fr
2011-12-20 16:56 ` [Bug fortran/51639] [4.6 Regression] " burnus at gcc dot gnu.org
2011-12-20 17:21 ` dominiq at lps dot ens.fr
2011-12-20 17:45 ` burnus 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).