public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>,Vladimir Makarov
	<vmakarov@redhat.com>,Jeff Law <law@redhat.com>,Bernd Schmidt
	<bernds_cb1@t-online.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix a pasto in lra-remat.c (reg_overlap_for_remat_p)
Date: Sat, 02 Sep 2017 12:38:00 -0000	[thread overview]
Message-ID: <ED0868F9-A2B3-4191-ABCC-92E071CB7220@gmail.com> (raw)
In-Reply-To: <20170901203310.GS2323@tucnak>

On September 1, 2017 10:33:10 PM GMT+02:00, Jakub Jelinek <jakub@redhat.com> wrote:
>Hi!
>
>This is something that has been reported privately to me.
>This is in code introduced in
>https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00660.html
>and looks indeed like a pasto to me, before the loop there is
>a very similar set of stmts without the 2 suffix, and unless
>regno being a hard reg (after possible reg_renumber) implies
>that regno2 (after possible reg_renumber) is a hard reg, if
>unlucky we might access out of bounds.
>
>I don't have a testcase for this, but have bootstrapped/regtested
>it on x86_64-linux and i686-linux, ok for trunk?

OK. 

Richard. 

>2017-09-01  Jakub Jelinek  <jakub@redhat.com>
>
>	* lra-remat.c (reg_overlap_for_remat_p): Fix a pasto.
>
>--- gcc/lra-remat.c.jj	2017-05-25 10:37:00.000000000 +0200
>+++ gcc/lra-remat.c	2017-09-01 19:42:07.615291583 +0200
>@@ -684,7 +684,7 @@ reg_overlap_for_remat_p (lra_insn_reg *r
> 
> 	if (regno2 >= FIRST_PSEUDO_REGISTER && reg_renumber[regno2] >= 0)
> 	  regno2 = reg_renumber[regno2];
>-	if (regno >= FIRST_PSEUDO_REGISTER)
>+	if (regno2 >= FIRST_PSEUDO_REGISTER)
> 	  nregs2 = 1;
> 	else
> 	  nregs2 = hard_regno_nregs[regno2][reg->biggest_mode];
>
>	Jakub

      reply	other threads:[~2017-09-02 12:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01 20:33 Jakub Jelinek
2017-09-02 12:38 ` Richard Biener [this message]

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=ED0868F9-A2B3-4191-ABCC-92E071CB7220@gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=bernds_cb1@t-online.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=law@redhat.com \
    --cc=vmakarov@redhat.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).