public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-4132] Fix PR 107734: valgrind errors with sbitmap in match.pd
Date: Thu, 17 Nov 2022 17:59:52 +0000 (GMT)	[thread overview]
Message-ID: <20221117175952.2A83F385456B@sourceware.org> (raw)

https://gcc.gnu.org/g:ee892832ea19b21a3420ef042e582204fac852a2

commit r13-4132-gee892832ea19b21a3420ef042e582204fac852a2
Author: Andrew Pinski <apinski@marvell.com>
Date:   Thu Nov 17 17:48:00 2022 +0000

    Fix PR 107734: valgrind errors with sbitmap in match.pd
    
    sbitmap is a simple bitmap and the memory allocated is not cleared
    on creation; you have to clear it or set it to all ones before using
    it.  This is unlike bitmap which is a sparse bitmap and the entries are
    cleared as created.
    The code added in r13-4044-gdc95e1e9702f2f missed that.
    This patch fixes that mistake.
    
    Committed as obvious after a bootstrap and test on x86_64-linux-gnu.
    
    gcc/ChangeLog:
    
            PR middle-end/107734
            * match.pd (perm + vector op pattern): Clear the sbitmap before
            use.

Diff:
---
 gcc/match.pd | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/match.pd b/gcc/match.pd
index 5aba1653b80..a4d1386fd9f 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -8288,6 +8288,8 @@ and,
 	   if (sel.encoding ().encoded_full_vector_p ())
 	     {
 	       auto_sbitmap seen (nelts);
+	       bitmap_clear (seen);
+
 	       unsigned HOST_WIDE_INT count = 0, i;
 
 	       for (i = 0; i < nelts; i++)

                 reply	other threads:[~2022-11-17 17:59 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=20221117175952.2A83F385456B@sourceware.org \
    --to=pinskia@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).