https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92956
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> --- (In reply to Martin Sebor from comment #2) > -Wstringop-overflow is a C-family only option that shouldn't be enabled for > Fortran. It took some effort to make it work that way […] I wouldn't be > surprised if the problem was still unresolved in LTO builds Well, this uses LTO – but only behind the scenes. When doing offloading (via OpenACC or OpenMP ["omp target"]), the blocks which are to be run on the device will be processes by a lto1 compiler for the device target (amdgcn, nvptx), see https://gcc.gnu.org/wiki/Offloading > I don't see this test in my builds or on gcc-testresults and compiling it > by hand gives the error below. […] > Fatal Error: Cannot open module file ‘omp_lib.mod’ for reading at (1): No > such file or directory I think in order to reproduce Thomas' problem, I fear you need to configure the compiler for actual offloading. (But see below.) Still, I do not understand the error message. This file is part of libgomp and installed along the compiler; in my case, it is in $INSTALL/lib64/gcc/x86_64-pc-linux-gnu/10.0.0/finclude/ and should be found automatically when calling 'gfortran'. * * * Regarding a test case, I actually stumbled over a test case this afternoon which fails without offloading. (There are 22 PASS and this one FAIL.) — I don't know whether it is your commit, but the message looks very similar. In any case: FAIL: gfortran.dg/lto/pr87689 f_lto_pr87689_0.o-f_lto_pr87689_1.o link, -O2 -flto -flto-partition=1to1 -fno-use-linker-plugin Which fails with: In function 'MAIN__', inlined from 'main' at gcc/testsuite/gfortran.dg/lto/pr87689_0.f:13:0: gcc/testsuite/gfortran.dg/lto/pr87689_0.f:10: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] gcc/testsuite/gfortran.dg/lto/pr87689_0.f: In function 'main': gcc/testsuite/gfortran.dg/lto/pr87689_0.f:7:22: note: at offset 1 to object 'c' with size 1 declared here The message is also bogus as one writes a single character to to a len=1 string.