View previous topic :: View next topic |
Author |
Message |
StamK
Joined: 12 Oct 2016 Posts: 167
|
Posted: Sat Jun 21, 2025 6:51 pm Post subject: Possible bug |
|
|
Whenever I try to compile the following subroutine (32bit or 64bit, v9.12.0), I am getting
Code: |
subroutine test_regression ()
REAL, ALLOCATABLE :: AIN(:)
nk = 1
ALLOCATE(AIN(NK), stat=IST)
DEALLOCATE(AIN(NK), stat=IST)
end subroutine
|
0048d5c4 make_nullify_tree(struct�tree_ptr,enum�logical,enum�logical) [+01ce]
0048ac84 process_allocate(int,<ref>struct�tree_ptr)#26 [+12ee]
0048cb1c handle_allocate(int,<ptr>char,int) [+06ff]
004111eb parse_executable_statement(<ptr>char,int,<ref>int) [+32a8]
004156d4 handle_token(<ptr>char,int,int,int,int,<ref>int) [+1230]
0040627a ProcessEntireLine(void) [+06c8]
004071fa compile(<ptr>char) [+016f]
0040181d main [+058e]
|
|
Back to top |
|
 |
StamK
Joined: 12 Oct 2016 Posts: 167
|
Posted: Sat Jun 21, 2025 6:53 pm Post subject: |
|
|
This is my Windows version
OS Name: Microsoft Windows 11 Home
OS Version: 10.0.26100 N/A Build 26100 |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8252 Location: Salford, UK
|
Posted: Sun Jun 22, 2025 7:00 am Post subject: |
|
|
StamK
Thank you for the bug report which is a regression in FTN95 at v9.12.
This has now been fixed for the next release. |
|
Back to top |
|
 |
StamK
Joined: 12 Oct 2016 Posts: 167
|
Posted: Sun Jun 22, 2025 9:15 am Post subject: |
|
|
Would it be possible to have updated EXE/DLLs in the support page? Thanks |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8252 Location: Salford, UK
|
Posted: Sun Jun 22, 2025 9:19 am Post subject: |
|
|
Yes. As it happened I did that before seeing your request. |
|
Back to top |
|
 |
StamK
Joined: 12 Oct 2016 Posts: 167
|
Posted: Sun Jun 22, 2025 5:19 pm Post subject: |
|
|
Confirmed fixed! |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 320
|
Posted: Tue Aug 26, 2025 8:40 am Post subject: similar issue? MODULE declared and compiled separately |
|
|
Compile this 3 line module separately, then comment it out before compiling the main program with /undef.
Code: |
!ftn95$free
module testmod
real*8, allocatable :: dshfts(:), deps(:)
end module testmod
program test
USE testMOD
if( allocated(dshfts)) deallocate (dshfts, STAT=IST)
if( allocated(deps)) deallocate (deps, STAT=IST)
vnull=-9.9e20
nkk = 7875
allocate (dshfts(nkk), stat=ist); dshfts=vnull
allocate (deps(nkk), stat=ist); deps=vnull
WRITE(*,*) "ok"
end program
|
make sure that your mod_path is looking in the local folder first
then
slink
lo objfilename
file
sdbg exefilename
if you hover over the "dshfts" on line 13, what do you see?
if it shows the array as "REAL*8(subscripts not valid)" then the ALLOCATED test (or the DEALLOCATE) gives an error (usually Access violation) when you step over.
if you uncomment the module code then compile the whole file with /undef and repeat the slink/sdbg, what do you see when you hover over the DSHFTS array:
If it's anything like what I'm seeing, the the hover description is now:
"unassigned [real*8 (Subscripts not valid)]
and the test passes and the program completes OK.
So, my question is:
what is the difference between a MODULE declared in the same source file that it is used in and
a MODULE that is compiled separately from the source code where it is used?
NOTE THAT ONLY SEEMS TO BE A PROBLEM WITH 32-BITS. 64BITS SEEMS TO BE OK?
K |
|
Back to top |
|
 |
Robert

Joined: 29 Nov 2006 Posts: 458 Location: Manchester
|
Posted: Tue Aug 26, 2025 8:38 pm Post subject: |
|
|
I'll have a look at this when I am back from my holiday |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 320
|
Posted: Wed Aug 27, 2025 7:42 am Post subject: |
|
|
I think i may have sussed my error.
if you only load the main object file in slink and don't specify to load the module object as well, then it fails at runtime.
if you include loading the module object code, then it all works!
D-oh!
K |
|
Back to top |
|
 |
|