aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Vieira <andre.simoesdiasvieira@arm.com>2023-03-02 14:11:59 +0000
committerAndre Vieira <andre.simoesdiasvieira@arm.com>2023-03-02 14:11:59 +0000
commit61407e018940633a9ca997bf3773f794faa25e23 (patch)
treef3cfddd13896a74f36e274e9399c8566f2c62060
parent62a8d31ecc07041af4a81353c2d57d9845c4b771 (diff)
downloadgcc-61407e018940633a9ca997bf3773f794faa25e23.zip
gcc-61407e018940633a9ca997bf3773f794faa25e23.tar.gz
gcc-61407e018940633a9ca997bf3773f794faa25e23.tar.bz2
simplify-rtx: Use byte in simplify_subreg rather than assume 0 offset
This patch fixes a missed review comment in an earlier patch using byte instead of a 0 offset. Also improves the comment as suggested. gcc/ChangeLog: * simplify-rtx.cc (simplify_context::simplify_subreg): Use byte instead of constant 0 offset.
-rw-r--r--gcc/simplify-rtx.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
index 2c82256..3b33afa 100644
--- a/gcc/simplify-rtx.cc
+++ b/gcc/simplify-rtx.cc
@@ -7667,10 +7667,10 @@ simplify_context::simplify_subreg (machine_mode outermode, rtx op,
}
}
- /* Try simplifying a SUBREG expression of a non-integer OUTERMODE by using a
- NEW_OUTERMODE of the same size instead, other simplifications rely on
- integer to integer subregs and we'd potentially miss out on optimizations
- otherwise. */
+ /* If the outer mode is not integral, try taking a subreg with the equivalent
+ integer outer mode and then bitcasting the result.
+ Other simplifications rely on integer to integer subregs and we'd
+ potentially miss out on optimizations otherwise. */
if (known_gt (GET_MODE_SIZE (innermode),
GET_MODE_SIZE (outermode))
&& SCALAR_INT_MODE_P (innermode)
@@ -7680,7 +7680,7 @@ simplify_context::simplify_subreg (machine_mode outermode, rtx op,
{
rtx tem = simplify_subreg (int_outermode, op, innermode, byte);
if (tem)
- return simplify_gen_subreg (outermode, tem, int_outermode, 0);
+ return simplify_gen_subreg (outermode, tem, int_outermode, byte);
}
/* If OP is a vector comparison and the subreg is not changing the