public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <botcazou@adacore.com>
To: gcc-patches@gcc.gnu.org
Subject: Fix PR testsuite/90806 on the 9 branch
Date: Wed, 06 Jan 2021 12:14:01 +0100	[thread overview]
Message-ID: <2897833.uCpS0FXm7W@fomalhaut> (raw)

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

The underlying bug was fixed by Marc in July 2019:

2019-07-10  Marc Glisse  <marc.glisse@inria.fr>

	* wide-int.h (wi::lshift): Reject negative values for the fastpath.

and Richard B. agreed to the backport onto the 9 branch.

Bootstrapped/regtested and applied on the 9 branch.


2021-01-06  Eric Botcazou <ebotcazou@adacore.com>

	PR testsuite/90806
	Backport from mainline
	2019-07-10  Marc Glisse  <marc.glisse@inria.fr>

	* wide-int.h (wi::lshift): Reject negative values for the fastpath.

-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 588 bytes --]

diff --git a/gcc/wide-int.h b/gcc/wide-int.h
index 25ea0545439..77aa01f2c98 100644
--- a/gcc/wide-int.h
+++ b/gcc/wide-int.h
@@ -3032,8 +3032,7 @@ wi::lshift (const T1 &x, const T2 &y)
       if (STATIC_CONSTANT_P (xi.precision > HOST_BITS_PER_WIDE_INT)
 	  ? (STATIC_CONSTANT_P (shift < HOST_BITS_PER_WIDE_INT - 1)
 	     && xi.len == 1
-	     && xi.val[0] <= (HOST_WIDE_INT) ((unsigned HOST_WIDE_INT)
-					      HOST_WIDE_INT_MAX >> shift))
+	     && IN_RANGE (xi.val[0], 0, HOST_WIDE_INT_MAX >> shift))
 	  : precision <= HOST_BITS_PER_WIDE_INT)
 	{
 	  val[0] = xi.ulow () << shift;

                 reply	other threads:[~2021-01-06 11:14 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=2897833.uCpS0FXm7W@fomalhaut \
    --to=botcazou@adacore.com \
    --cc=gcc-patches@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).