* [Committed] PR middle-end/102031: Fix typo/mistake in simplify_truncation patch
@ 2021-08-24 21:15 Roger Sayle
0 siblings, 0 replies; only message in thread
From: Roger Sayle @ 2021-08-24 21:15 UTC (permalink / raw)
To: 'GCC Patches'
[-- Attachment #1: Type: text/plain, Size: 607 bytes --]
My apologies again. My patch to simplify truncations of SUBREGs in
simplify-rtx.c contained an error where I'd accidentally compared
against a mode instead of the precision of that mode. Grr! It even
survived regression testing on two platforms. Fixed below, and
committed as obvious, after a full "make bootstrap" and "make -k check"
on x86_64-pc-linux-gnu with no new regressions.
2021-08-24 Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog
PR middle-end/102031
* simplify-rtx.c (simplify_truncation): When comparing precisions
use "subreg_prec" variable, not "subreg_mode".
Roger
--
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 959 bytes --]
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 8eea9fb..c81e27e 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -841,7 +841,7 @@ simplify_context::simplify_truncation (machine_mode mode, rtx op,
{
unsigned int int_op_prec = GET_MODE_PRECISION (int_op_mode);
unsigned int subreg_prec = GET_MODE_PRECISION (subreg_mode);
- if (int_op_prec > subreg_mode)
+ if (int_op_prec > subreg_prec)
{
if (int_mode == subreg_mode)
return SUBREG_REG (op);
@@ -851,7 +851,7 @@ simplify_context::simplify_truncation (machine_mode mode, rtx op,
}
/* Simplification of (truncate:A (subreg:B X:C 0)) where
A is narrower than B and B is narrower than C. */
- else if (int_op_prec < subreg_mode
+ else if (int_op_prec < subreg_prec
&& GET_MODE_PRECISION (int_mode) < int_op_prec)
return simplify_gen_unary (TRUNCATE, int_mode,
SUBREG_REG (op), subreg_mode);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-24 21:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24 21:15 [Committed] PR middle-end/102031: Fix typo/mistake in simplify_truncation patch 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).