public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Avoid memcpy inline expansion in gcc.dg/out-of-bounds-1.c
Date: Wed, 29 Sep 2021 08:07:23 +0200 (CEST)	[thread overview]
Message-ID: <6113sno0-9rn3-r097-4984-qp4911s61q9q@fhfr.qr> (raw)

This avoids inline expansion to preserve the warning by making
the memcpy size a non-power-of-two as suggested by Martin Sebor.

Tested on x86_64-unknown-linux-gnu, pushed.

2021-09-29  Richard Biener  <rguenther@suse.de>

	* gcc.dg/out-of-bounds-1.c: Make memcpied size not power-of-two.
---
 gcc/testsuite/gcc.dg/out-of-bounds-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/out-of-bounds-1.c b/gcc/testsuite/gcc.dg/out-of-bounds-1.c
index 1c76341af27..5c134c096e3 100644
--- a/gcc/testsuite/gcc.dg/out-of-bounds-1.c
+++ b/gcc/testsuite/gcc.dg/out-of-bounds-1.c
@@ -8,6 +8,6 @@
 void ProjectOverlay(const float localTextureAxis[2], char *lump)
 {
    const void *d = &localTextureAxis;
-   int size = sizeof(float)*8 ;
+   int size = sizeof(float)*7 ;
    __builtin_memcpy( &lump[ 0 ], d, size );  /* { dg-warning "reading" } */
 }
-- 
2.31.1

                 reply	other threads:[~2021-09-29  6:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6113sno0-9rn3-r097-4984-qp4911s61q9q@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    /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).