Bugreport for the fortran compiler: Treatment of array bounds in the specification part

Hi all, some time ago I’ve faced an interesting difference in behaviour between different compilers.

Briefly, if there is a function, where in the specification part the ubounds/lbounds functions are used in the specification part, e.g.


the actual size of the declared array will be different, as if ubound is calculated before the declaration of the array.

See details here fortran-lang.discourse.group/.../3

My assumption is that such a behaviour is a bug.

Best regards,
Andrii

P.S. As of now I've tested this code

with 24.10.1 on Rocky9 (RHEL9).

Edit:  actually the bug is present in 23.10, but seems to be  absent in 24.10.1.

0