public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Darrington <john@darrington.wattle.id.au>
To: gcc-patches@gnu.org
Cc: John Darrington <john@darrington.wattle.id.au>
Subject: [PATCH] simplify-rtx.c (simplify_unary_operation_1): Change BITSIZE to PRECISION.
Date: Mon, 08 Jul 2019 07:26:00 -0000	[thread overview]
Message-ID: <20190708071108.773-2-john@darrington.wattle.id.au> (raw)
In-Reply-To: <20190708071108.773-1-john@darrington.wattle.id.au>

gcc/
* simplify-rtx.c (simplify_unary_operation_1): Change BITSIZE to PRECISION
 in simplification of (extend ashiftrt (ashift ..)))  Otherwise the
 gcc_assert can catch when dealing with partial int modes.
---
 gcc/ChangeLog      | 6 ++++++
 gcc/simplify-rtx.c | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5d3d359..919b9e9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-07-04  John Darrington <john@darrington.wattle.id.au>
+
+	simplify-rtx.c: Change BITSIZE to UNIT_PRECISION in simplification of
+	(extend ashiftrt (ashift ..)))  Otherwise the gcc_assert will catch
+	when dealing with partial int modes.
+
 2019-07-04  Jakub Jelinek  <jakub@redhat.com>
 
 	* omp-low.c (lower_omp_scan): Call lower_omp on stmt's body
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 89a46a9..d1cd428 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1504,12 +1504,12 @@ simplify_unary_operation_1 (enum rtx_code code, machine_mode mode, rtx op)
 	  && CONST_INT_P (XEXP (op, 1))
 	  && XEXP (XEXP (op, 0), 1) == XEXP (op, 1)
 	  && (op_mode = as_a <scalar_int_mode> (GET_MODE (op)),
-	      GET_MODE_BITSIZE (op_mode) > INTVAL (XEXP (op, 1))))
+	      GET_MODE_PRECISION (op_mode) > INTVAL (XEXP (op, 1))))
 	{
 	  scalar_int_mode tmode;
-	  gcc_assert (GET_MODE_BITSIZE (int_mode)
-		      > GET_MODE_BITSIZE (op_mode));
-	  if (int_mode_for_size (GET_MODE_BITSIZE (op_mode)
+	  gcc_assert (GET_MODE_PRECISION (int_mode)
+		      > GET_MODE_PRECISION (op_mode));
+	  if (int_mode_for_size (GET_MODE_PRECISION (op_mode)
 				 - INTVAL (XEXP (op, 1)), 1).exists (&tmode))
 	    {
 	      rtx inner =
-- 
1.8.3.1

       reply	other threads:[~2019-07-08  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190708071108.773-1-john@darrington.wattle.id.au>
2019-07-08  7:26 ` John Darrington [this message]
2019-07-09 19:22   ` Jeff Law

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=20190708071108.773-2-john@darrington.wattle.id.au \
    --to=john@darrington.wattle.id.au \
    --cc=gcc-patches@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).