public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] PR target/106640: Fix use of XINT in TImode compute_convert_gain.
@ 2022-08-17 21:28 Roger Sayle
  0 siblings, 0 replies; only message in thread
From: Roger Sayle @ 2022-08-17 21:28 UTC (permalink / raw)
  To: 'GCC Patches'

[-- 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-17 21:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17 21:28 [Committed] PR target/106640: Fix use of XINT in TImode compute_convert_gain Roger Sayle

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).