[Bug fortran/69368] [6 Regression] spec2006 test case 416.gamess fails with the g++ 6.0 compiler starting with r232508

dominiq at lps dot ens.fr gcc-bugzilla@gcc.gnu.org
Thu Feb 18 21:30:00 GMT 2016


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.


More information about the Gcc-bugs mailing list