public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Roger Sayle" <roger@nextmovesoftware.com>
To: "'GCC Patches'" <gcc-patches@gcc.gnu.org>
Subject: [Committed] PR target/106640: Fix use of XINT in TImode compute_convert_gain.
Date: Wed, 17 Aug 2022 22:28:11 +0100	[thread overview]
Message-ID: <011f01d8b280$41a4ff80$c4eefe80$@nextmovesoftware.com> (raw)

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


Thanks to Zdenek Sojka for reporting PR target/106640 where an RTL checking
build reveals a thinko in my recent patch to support TImode shifts/rotates
in STV.  My "senior moment" was to inappropriately use XINT where I should
be using INTVAL of XEXP.  I can't imagine what I was thinking.  Corrected
by the patch below, tested on x86_64-pc-linux-gnu with make bootstrap,
both with and without --enable-checking=rtl, and regression tested, both
with and without --target_board=unix{-m32}, with no new failures.
Committed to mainline as obvious.


2022-08-17  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
        PR target/106640
        * config/i386/i386-features.cc
        (timde_scalar_chain::compute_convert_gain): Replace incorrect use
        of XINT with INTVAL (XEXP (src, 1)).

Roger
--


[-- Attachment #2: patchxi.txt --]
[-- Type: text/plain, Size: 1076 bytes --]

diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc
index 821d8c7..d6bb66c 100644
--- a/gcc/config/i386/i386-features.cc
+++ b/gcc/config/i386/i386-features.cc
@@ -1248,7 +1248,7 @@ timode_scalar_chain::compute_convert_gain ()
 	case ASHIFT:
 	case LSHIFTRT:
 	  /* See ix86_expand_v1ti_shift.  */
-	  op1val = XINT (src, 1);
+	  op1val = INTVAL (XEXP (src, 1));
 	  if (optimize_insn_for_size_p ())
 	    {
 	      if (op1val == 64 || op1val == 65)
@@ -1282,7 +1282,7 @@ timode_scalar_chain::compute_convert_gain ()
 
 	case ASHIFTRT:
 	  /* See ix86_expand_v1ti_ashiftrt.  */
-	  op1val = XINT (src, 1);
+	  op1val = INTVAL (XEXP (src, 1));
 	  if (optimize_insn_for_size_p ())
 	    {
 	      if (op1val == 64 || op1val == 127)
@@ -1355,7 +1355,7 @@ timode_scalar_chain::compute_convert_gain ()
 	case ROTATE:
 	case ROTATERT:
 	  /* See ix86_expand_v1ti_rotate.  */
-	  op1val = XINT (src, 1);
+	  op1val = INTVAL (XEXP (src, 1));
 	  if (optimize_insn_for_size_p ())
 	    {
 	      scost = COSTS_N_BYTES (13);

                 reply	other threads:[~2022-08-17 21:28 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='011f01d8b280$41a4ff80$c4eefe80$@nextmovesoftware.com' \
    --to=roger@nextmovesoftware.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).