Hi,

On darwin (both x86_64-apple-darwin and aarch64-apple-darwin) we see the 
following test failure:

FAIL: gcc.dg/lto/20091013-1 c_lto_20091013-1_2.o assemble, -fPIC -r -nostdlib 
-O2 -flto

which is due to this extra warning:

In function 'fontcmp',
    inlined from 'find_in_cache' at 
/tmp/gcc-darwin-arm64/gcc/testsuite/gcc.dg/lto/20091013-1_2.c:140:13,
    inlined from 'WineEngCreateFontInstance' at 
/tmp/gcc-darwin-arm64/gcc/testsuite/gcc.dg/lto/20091013-1_2.c:160:15:
/tmp/gcc-darwin-arm64/gcc/testsuite/gcc.dg/lto/20091013-1_2.c:107:8: warning: 
'memcmp' specified bound 4 exceeds source size 0 [-Wst
ringop-overread]
/tmp/gcc-darwin-arm64/gcc/testsuite/gcc.dg/lto/20091013-1_2.c: In function 
'WineEngCreateFontInstance':
/tmp/gcc-darwin-arm64/gcc/testsuite/gcc.dg/lto/20091013-1_2.c:66:20: note: 
source object allocated here

Now, the main file for the test has:

/* { dg-extra-ld-options "-flinker-output=nolto-rel -Wno-stringop-overread" } */

and I believe the intent of -Wno-stringop-overread is to silence this warning, 
but that only applies to the linker, and the warning on darwin is produced by 
the compiler (in addition to the linker). Adding the flag to the compilation of 
the source file makes the test pass on darwin.

OK to commit?
FX


Attachment: 0001-Testsuite-LTO-silence-warning-to-make-test-pass-on-D.patch
Description: Binary data

Reply via email to