When trying to compile OpenMolcas with gcc 10.1 and link-time optimization I get: ../src/slapaf_util/outofplane_list.f: In function ‘outofplane_list’: ../src/slapaf_util/outofplane_list.f:524: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] 524 | Lbls(3)(iE3+1:iE3+1)='(' | ../src/slapaf_util/outofplane_list.f:45:32: note: at offset 0 to object ‘lbls’ with size 40 declared here 45 | Character*(LENIN4) Lbls(4) | ^ [...] lto1: all warnings being treated as errors lto-wrapper: fatal error: /usr/bin/gfortran returned 1 exit status How is "Lbls(3)(iE3+1:iE3+1)" a region of size 0? Similar constructs elsewhere don't raise the flag. Does the compiler believe "iE3+1" is beyond the length of the string? But then it says nothing without -flto.
Can you attach a TU where this issue shows?
What's a TU? I didn't succeed (but didn't try to hard) in creating a minimal test case. But this reproduces the problem: $ git clone -b ipo https://gitlab.com/Molcas/OpenMolcas.git $ cd OpenMolcas $ git submodule update --init External/lapack # (comment out the line in src/gateway_util/Symmetry_Info.f90 # that refers to this report, i.e. search for 101827. # But note that the "ipo" branch is in development and will change.) $ mkdir build $ cd build $ cmake -D BUILD_SHARED_LIBS=ON -D BIGOT=ON .. $ make [...] [ 65%] Linking Fortran shared library lib/libmolcas.so In function ‘chtab’, inlined from ‘__symmetry_info_MOD_symmetry_info_setup.part.0’ at /OpenMolcas/src/gateway_util/Symmetry_Info.f90:335:0: /OpenMolcas/src/gateway_util/Symmetry_Info.f90:655: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] 655 | lIrrep(iIrrep-1)(i1:i1)='u' | /OpenMolcas/src/gateway_util/Symmetry_Info.f90: In function ‘__symmetry_info_MOD_symmetry_info_setup.part.0’: /OpenMolcas/src/gateway_util/Symmetry_Info.f90:17:60: note: at offset 0 to object ‘lirrep’ with size 24 declared here 17 | Public :: nIrrep, iOper, iChTbl, iChCar, Mul, iChBas, lIrrep, lBsFnc, SymLab, iSkip, & | ^ In function ‘chtab’, inlined from ‘__symmetry_info_MOD_symmetry_info_setup.part.0’ at /OpenMolcas/src/gateway_util/Symmetry_Info.f90:335:0: /OpenMolcas/src/gateway_util/Symmetry_Info.f90:653: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] 653 | lIrrep(iIrrep-1)(i1:i1)='g' | /OpenMolcas/src/gateway_util/Symmetry_Info.f90: In function ‘__symmetry_info_MOD_symmetry_info_setup.part.0’: /OpenMolcas/src/gateway_util/Symmetry_Info.f90:17:60: note: at offset 0 to object ‘lirrep’ with size 24 declared here 17 | Public :: nIrrep, iOper, iChTbl, iChCar, Mul, iChBas, lIrrep, lBsFnc, SymLab, iSkip, & | ^ lto1: all warnings being treated as errors lto-wrapper: fatal error: /usr/bin/gfortran returned 1 exit status