From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59846 invoked by alias); 2 Sep 2017 12:38:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 59342 invoked by uid 89); 2 Sep 2017 12:38:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f67.google.com Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 02 Sep 2017 12:38:26 +0000 Received: by mail-wm0-f67.google.com with SMTP id p17so2401062wmd.3 for ; Sat, 02 Sep 2017 05:38:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:cc:from :message-id; bh=rkVivwJm50C8HK9SStZidolQhG/R2CkqGescVTsTSzA=; b=ayZqull3vbKRWhSgzRp3YF4MquBMj/jTI8utTu3JMCg7emgS+awaUfU96lt9aIXlbo /OelivOX9AOiZ88fliboKzjVPIwPPFfVg3kEh7oPEXeD/dEMzjBdD/XbPBTsuZfFaX/q YRBZCcTr2IJwLqRoyOZhRIZ2XIO9FDiSWXq4VcoQPtvQd1ywCwXOHsdLgzYQS2XA5oxU OH+lYKNyJNqKjk92BZUnFt2xadKjwx4o3ZwjtWD++1fL2netIJOQI08z5BgYqxKfpsm8 YFfSoiwEwGpzK5b9ccuLpwjs+LC+b1p1d4BAqTXD1L8hEO2ExUQvMqzBD5cYKJoMlBBD 7PMQ== X-Gm-Message-State: AHPjjUhJ8efuIfODnFJPQzCFhJVtMbdFhkWajzSjftdge9WoA6dIITzT UqO1FDVG/akzkA== X-Google-Smtp-Source: ADKCNb5vaW8n5fsIzwrDUpfu3V653CJyhuI31zGf5YCIl6MdHXJ8PC1C2Ptg/0f2NfF+x1aBziSIUw== X-Received: by 10.28.139.72 with SMTP id n69mr730628wmd.15.1504355904852; Sat, 02 Sep 2017 05:38:24 -0700 (PDT) Received: from android-f83b394395796e13.fritz.box (p5494E583.dip0.t-ipconnect.de. [84.148.229.131]) by smtp.gmail.com with ESMTPSA id b70sm1827747wmf.7.2017.09.02.05.38.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Sep 2017 05:38:24 -0700 (PDT) Date: Sat, 02 Sep 2017 12:38:00 -0000 User-Agent: K-9 Mail for Android In-Reply-To: <20170901203310.GS2323@tucnak> References: <20170901203310.GS2323@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] Fix a pasto in lra-remat.c (reg_overlap_for_remat_p) To: Jakub Jelinek ,Vladimir Makarov ,Jeff Law ,Bernd Schmidt CC: gcc-patches@gcc.gnu.org From: Richard Biener Message-ID: X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00104.txt.bz2 On September 1, 2017 10:33:10 PM GMT+02:00, Jakub Jelinek 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.=20 Richard.=20 >2017-09-01 Jakub Jelinek > > * 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 >=20 > if (regno2 >=3D FIRST_PSEUDO_REGISTER && reg_renumber[regno2] >=3D 0) > regno2 =3D reg_renumber[regno2]; >- if (regno >=3D FIRST_PSEUDO_REGISTER) >+ if (regno2 >=3D FIRST_PSEUDO_REGISTER) > nregs2 =3D 1; > else > nregs2 =3D hard_regno_nregs[regno2][reg->biggest_mode]; > > Jakub