public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@redhat.com>
To: "Kewen.Lin" <linkw@linux.ibm.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Bill Schmidt <wschmidt@linux.ibm.com>,
	Segher Boessenkool <segher@kernel.crashing.org>
Subject: Re: [PATCH]ira: recompute regstat as max_regno changes [PR97705]
Date: Fri, 6 Nov 2020 09:49:33 -0500	[thread overview]
Message-ID: <c9c62a22-6893-45fa-7cb3-f86810cc4f28@redhat.com> (raw)
In-Reply-To: <dd94a51c-8a39-0e3c-a00d-7a93bf15d443@linux.ibm.com>


On 2020-11-06 1:15 a.m., Kewen.Lin wrote:
> Hi,
>
> As PR97705 shows, my commit r11-4637 caused some dumping
> comparison difference error on pass ira.  It exposed one
> issue about the newly introduced function remove_scratches,
> which can increase the largest pseudo reg number if it
> succeeds, later some function will use the max_reg_num()
> to get the latest max_regno, when iterating the numbers
> we can access some data structures which are allocated as
> the previous max_regno, some out of array bound accesses
> can occur, the failure can be random since the values
> beyond the array could be random.
>
> This patch is to free/reinit/recompute the relevant data
> structures that is regstat_n_sets_and_refs and reg_info_p
> to ensure we won't access beyond some array bounds.
>
> Bootstrapped/regtested on powerpc64le-linux-gnu P9 and
> powerpc64-linux-gnu P8.
>
> Any thoughts?  Is it a reasonable fix?
>
Sure, Kewen.  A bit unexpected to see lambda to use for this but I 
checked and found couple places in GCC where lambdas are already used.

The patch is ok.  Please, commit it to the mainline.

Thank you for the patch.


  reply	other threads:[~2020-11-06 14:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06  6:15 Kewen.Lin
2020-11-06 14:49 ` Vladimir Makarov [this message]
2020-11-09  5:27   ` Kewen.Lin

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=c9c62a22-6893-45fa-7cb3-f86810cc4f28@redhat.com \
    --to=vmakarov@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.ibm.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).