public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "linkw at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/97705] [11 regression] cc.c-torture/unsorted/dump-noaddr.c.*r.ira fails after r11-4637
Date: Thu, 05 Nov 2020 05:58:19 +0000	[thread overview]
Message-ID: <bug-97705-4-rOP0prw39o@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97705-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97705

--- Comment #4 from Kewen Lin <linkw at gcc dot gnu.org> ---
I think my commit just exposed one bug in ira. The newly introduced function
remove_scratches can bump the max_regno, then the data structures
regstat_n_sets_and_refs and reg_info_p which are allocated according to
max_regno become stale. When we call print_pseudo_costs to dump some register
information, it use the latest regno with max_reg_num (), it leads we can
access some regno which don't have relevant data structures which have been
allocated, the read values can be random (out of array bound access).

The fix can be to free/re-init/re-compute the relevant data structures when we
know the max_regno already changes like remove_scratches succeeds.

  parent reply	other threads:[~2020-11-05  5:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 16:28 [Bug other/97705] New: " seurer at gcc dot gnu.org
2020-11-03 17:15 ` [Bug other/97705] " seurer at gcc dot gnu.org
2020-11-04  2:11 ` linkw at gcc dot gnu.org
2020-11-04  8:10 ` [Bug testsuite/97705] " rguenth at gcc dot gnu.org
2020-11-04  9:42 ` linkw at gcc dot gnu.org
2020-11-05  5:58 ` linkw at gcc dot gnu.org [this message]
2020-11-09  4:28 ` [Bug rtl-optimization/97705] " cvs-commit at gcc dot gnu.org
2020-11-09  5:55 ` linkw at gcc dot gnu.org

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=bug-97705-4-rOP0prw39o@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).