https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100440
--- Comment #8 from David.Smith at lmu dot edu --- That is not good. The expected results from my test case with debug prints commented out should be this: Sample 10. Eigenvalue from matrix powers. Iteration eigenvalue approximation 0 1.000000000000000000000000000000000000000000000000000000000 1 24.238372093023255813953488372093023255813953488372093023260 2 23.913064457596406344892377530895927499788142161414894216110 3 23.912767173080067549422508320051584489821761621077098788510 4 23.912767172321328589362041859914215096468342615030281071820 5 23.912767172321328589357039228003304505549129411762921508580 6 23.912767172321328589357039228003304505549129195999272982170 7 23.912767172321328589357039228003304505549129195999272982160 David Smith ________________________________________ From: kargl at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> Sent: Friday, May 7, 2021 2:09 PM To: Smith, David Subject: [Bug fortran/100440] allocated() gives True for unallocated variable https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100440 --- Comment #5 from kargl at gcc dot gnu.org --- David, On amd64-*-freebsd, I see % gfcx -o z -O2 -fcheck=all allocate_error.f95 % ./z Sample 10. Eigenvalue from matrix powers. Iteration eigenvalue approximation 0 1.000000000000000000000000000000000000000000000000000000000 21 j= 1 allocated(FMMATMUL21_FM(J)%MFM%mp) = F allocated(FMMATMUL21_FM(J)%MFM%mp) = F At line 2499 of file allocate_error.f95 Fortran runtime error: Allocatable argument 'fmmatmul21_fm' is not allocated with a number of different options. The runtime error is expected as 'allocated(FMMATMUL21_FM(J)%MFM%mp) = F', and the print statement checking size() is not protected by an 'if' statement. valgrind shows ==8708== HEAP SUMMARY: ==8708== in use at exit: 10,737 bytes in 68 blocks ==8708== total heap usage: 170 allocs, 102 frees, 40,166 bytes allocated ==8708== ==8708== LEAK SUMMARY: ==8708== definitely lost: 0 bytes in 0 blocks ==8708== indirectly lost: 0 bytes in 0 blocks ==8708== possibly lost: 0 bytes in 0 blocks ==8708== still reachable: 10,737 bytes in 68 blocks ==8708== suppressed: 0 bytes in 0 blocks which suggests that this might be a MacOS specific bug. Note, if I comment out your print statement for diagnostics, I see % ./z Sample 10. Eigenvalue from matrix powers. Iteration eigenvalue approximation 0 1.000000000000000000000000000000000000000000000000000000000 1 24.238372093023255813953488372093023255813953488372093023260 2 .889072890369341844887411185964338107009906299229814263038M+20 3 .102214801410512542129975983352534954405105702575200225476M+43 4 .133558489514054527062720546215032551914781174136345314241M+87 5 .321140870607048831918216893831115589158773657747578318060M+175 6 .205341864155723417152215792855218285040195823798023639691M+352 7 .667355770417440618516624449043958628107088436355045114363M+705 -- You are receiving this mail because: You reported the bug.