https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104845
Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID CC| |pault at gcc dot gnu.org --- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> --- (In reply to Mikael Morin from comment #3) > (In reply to Tobias Burnus from comment #0) > > > > allocate (t :: var%ct2%d(3,2), var%ct2a(5,4,2)%d(3,2)) > > allocate (t :: cvar%ct2%d(3,2), cvar%ct2a(5,4,2)%d(3,2)) > > > > Thus, the expected array size is 3*2 = 6. However, the result is > > 6 0 6 0 > > for > > print *, size(var%ct2%d), size(var%ct2a(5,3,2)%d), & > > size(cvar%ct2%d), size(cvar%ct2a(5,3,2)%d) > > > > where 'ct2' is scalar > > and 'ct2a(5,3,2)' is an array element (also scalar) > > ct2a(5,3,2)%d isn’t allocated, should it be ct2a(5,4,2)%d ? Hi Mikael, I just came across this after fixing PR104844. You are quite correct and the result is consistent with the component not being allocated. Changing the array reference to be consistent gives the correct result. Closing as invalid, although it did cause me to do some code simplification in both size and sizeof. Regards Paul