public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: FX Coudert <fxcoudert@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: Iain Sandoe <iains.gcc@gmail.com>
Subject: [PATCH] Testsuite, LTO: silence warning to make test pass on Darwin
Date: Sun, 20 Aug 2023 12:24:00 +0200	[thread overview]
Message-ID: <A2FB735F-882D-4F5E-96A4-DA2F79084F11@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]

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 #2: 0001-Testsuite-LTO-silence-warning-to-make-test-pass-on-D.patch --]
[-- Type: application/octet-stream, Size: 846 bytes --]

From 4aa64187fa35dcb9a23d66ef875cf1bab4937c55 Mon Sep 17 00:00:00 2001
From: Francois-Xavier Coudert <fxcoudert@gmail.com>
Date: Sun, 20 Aug 2023 12:17:50 +0200
Subject: [PATCH] Testsuite, LTO: silence warning to make test pass on Darwin

gcc/testsuite/ChangeLog:

	* gcc.dg/lto/20091013-1_2.c: Add -Wno-stringop-overread.
---
 gcc/testsuite/gcc.dg/lto/20091013-1_2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
index 1af49aa97b6..89caea868e6 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -1,3 +1,5 @@
+/* { dg-options "-Wno-stringop-overread" } */
+
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
 
-- 
2.39.2 (Apple Git-143)


             reply	other threads:[~2023-08-20 10:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-20 10:24 FX Coudert [this message]
2023-08-21  7:26 ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A2FB735F-882D-4F5E-96A4-DA2F79084F11@gmail.com \
    --to=fxcoudert@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iains.gcc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).