public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Robin Dapp <rdapp@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-7991] testsuite: Add -fno-tree-loop-distribute-patterns.
Date: Tue,  5 Apr 2022 06:52:51 +0000 (GMT)	[thread overview]
Message-ID: <20220405065251.AB5363858C53@sourceware.org> (raw)

https://gcc.gnu.org/g:321d1dcf610d8af8da4c1feb76819fea24fcd27e

commit r12-7991-g321d1dcf610d8af8da4c1feb76819fea24fcd27e
Author: Robin Dapp <rdapp@linux.ibm.com>
Date:   Fri Apr 1 09:52:56 2022 +0200

    testsuite: Add -fno-tree-loop-distribute-patterns.
    
    In gcc.dg/Wuse-after-free-2.c we try to detect a use-after-free.  The
    test's while loop is converted into a rawmemchr builtin making
    it impossible to determine that the pointers *p and *q are related.
    
    Therefore, disable the tree loop distribute patterns pass for this test.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.dg/Wuse-after-free-2.c:
            Add -fno-tree-loop-distribute-patterns in order to avoid
            rawmemchr.

Diff:
---
 gcc/testsuite/gcc.dg/Wuse-after-free-2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/Wuse-after-free-2.c b/gcc/testsuite/gcc.dg/Wuse-after-free-2.c
index 9f7ed4529f0..68ec75845ce 100644
--- a/gcc/testsuite/gcc.dg/Wuse-after-free-2.c
+++ b/gcc/testsuite/gcc.dg/Wuse-after-free-2.c
@@ -1,6 +1,6 @@
 /* PR middle-end/104232 - spurious -Wuse-after-free after conditional free
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -fno-tree-loop-distribute-patterns" }  */
 
 void free (void*);
 
@@ -107,6 +107,8 @@ int warn_cond_loop (char *p)
 {
   char *q = p;
 
+  /*  -fno-tree-loop-distribute-patterns ensures this does not get converted
+      into rawmemchr (making q and p unrelated).  */
   while (*q)
     ++q;


                 reply	other threads:[~2022-04-05  6:52 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=20220405065251.AB5363858C53@sourceware.org \
    --to=rdapp@gcc.gnu.org \
    --cc=gcc-cvs@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).