forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Regression with NULL(?) pointers in FTN 8.20

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
Andre



Joined: 19 Jan 2017
Posts: 14

PostPosted: Tue Mar 20, 2018 2:25 pm    Post subject: Regression with NULL(?) pointers in FTN 8.20 Reply with quote

I found a regression in FTN95/64. Consider the following program:

Code:

module bar
    implicit none
contains
    subroutine foo()
        integer, pointer :: p => null()
        write(*,*) loc(p)
    end subroutine
end module

program pointer
    use bar
    implicit none

    call foo()
end program


Compiled with
Code:
ftn95 main.f90 /link

this works just fine (gives 0 as output).
However, if I compile with
Code:
ftn95 /64 main.f90 /link

my output is 8589934592, which is definitely wrong. This worked fine for FTN95 8.10.

Interestingly, if foo is external (i.e. not defined within a CONTAINS scope) or if I define the pointer within the main PROGRAM, the problem does not seem to appear.

Part 2:
Even more interesting, if I add a NULLIFY(p) just below the pointer definition, FTN64 gives me the following weird error message:

This is definitely a bug (and also a regression to FTN95 8.10).

...continuation:
Part 2 is even more involved than I first thought. Consider the following code:
Code:

module bar
    implicit none
contains
    subroutine foo()
        integer, pointer :: p => null()
        write(*,*) loc(p)
    end subroutine
end module

program pointer
    implicit none
    integer, pointer :: pp => null()

    nullify(pp)
    write(*,*) loc(pp)

end program

Same weird error message in 64 bit. However if I remove subroutine foo (which I am not using anyway), the program works fine again.
Everything works fine in FTN 8.10.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Tue Mar 20, 2018 3:23 pm    Post subject: Reply with quote

The same result is obtained with the current release (v8.30).
I have made a note that this needs investigating.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Wed Mar 21, 2018 12:42 pm    Post subject: Reply with quote

This has been fixed for the next release of FTN95.

Anyone who needs this construction immediately should update to version 8.30 and then send me a message on this forum so that I can provide a link to a new FTN95.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group