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

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 18 13:30:00 GMT 2016


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

--- Comment #45 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Consider e.g. one source file
      INTEGER FOO
      COMMON /BLK/ K(64)
      DO I=1,64
      K(I)=1
      END DO
      IF (FOO(5,12).NE.51) CALL ABORT
      END
and another one:
      FUNCTION FOO(I, J)
      COMMON /BLK/ K(1)
      FOO = K(I) + K(J) + K(2*I) + K(2*J)
      END FUNCTION
If the second source file is compiled with -O2, it will return "wrong" value,
as if all accesses to K were using the same index (because the only valid index
is 1).  If you compile with -O2 -fno-tree-dominator-opts, then it "works".


More information about the Gcc-bugs mailing list