https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69368

--- Comment #56 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> >       FUNCTION FOO(I, J)
> >       COMMON /BLK/ K(1)
> >       FOO = K(I) + K(J) + K(2*I) + K(2*J)
> >       END FUNCTION

This piece of code is also invalid (out of bound access to K): K(I) + K(J) is
valid iff I=J=1, but K(2*I) + K(2*J) is always accessing elements outside the
array K(1).

> The correct solution to me is to detect the unequal sizes and convert
> the COMMON /BLK/ K(1) to the larger size, ie K(64).

This can be done at link time only if the two TU are in different files.

Reply via email to