aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2022-11-04 11:15:57 +0100
committerEric Botcazou <ebotcazou@adacore.com>2022-11-04 15:14:50 +0100
commit3e2bdf2460a34a2389dee813a2ba8ecf976f2ec9 (patch)
treebbb61cdd604298c8ba3893e53f2c554a314aa2fd
parent418999fe382c608facf57f96b53a9cb12d2fdd20 (diff)
downloadgcc-3e2bdf2460a34a2389dee813a2ba8ecf976f2ec9.zip
gcc-3e2bdf2460a34a2389dee813a2ba8ecf976f2ec9.tar.gz
gcc-3e2bdf2460a34a2389dee813a2ba8ecf976f2ec9.tar.bz2
Do not use subword paradoxical subregs in emit_group_store
The goal of the trick is to make life easier for the combiner, but subword paradoxical subregs make it harder for the register allocator instead. gcc/ * expr.cc (emit_group_store): Do not use subword paradoxical subregs
-rw-r--r--gcc/expr.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/expr.cc b/gcc/expr.cc
index 9145193..c6917fb 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -2901,19 +2901,19 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED,
if (!REG_P (dst) || REGNO (dst) < FIRST_PSEUDO_REGISTER)
dst = gen_reg_rtx (outer);
- /* Make life a bit easier for combine. */
- /* If the first element of the vector is the low part
- of the destination mode, use a paradoxical subreg to
- initialize the destination. */
+ /* Make life a bit easier for combine: if the first element of the
+ vector is the word (or larger) low part of the destination mode,
+ use a paradoxical subreg to initialize the destination. */
if (start < finish)
{
inner = GET_MODE (tmps[start]);
bytepos = subreg_lowpart_offset (inner, outer);
- if (known_eq (rtx_to_poly_int64 (XEXP (XVECEXP (src, 0, start), 1)),
- bytepos))
+ if (known_ge (GET_MODE_BITSIZE (inner), BITS_PER_WORD)
+ && known_eq (rtx_to_poly_int64 (XEXP (XVECEXP (src, 0,
+ start), 1)),
+ bytepos))
{
- temp = simplify_gen_subreg (outer, tmps[start],
- inner, 0);
+ temp = simplify_gen_subreg (outer, tmps[start], inner, 0);
if (temp)
{
emit_move_insn (dst, temp);
@@ -2929,12 +2929,12 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED,
{
inner = GET_MODE (tmps[finish - 1]);
bytepos = subreg_lowpart_offset (inner, outer);
- if (known_eq (rtx_to_poly_int64 (XEXP (XVECEXP (src, 0,
- finish - 1), 1)),
- bytepos))
+ if (known_ge (GET_MODE_BITSIZE (inner), BITS_PER_WORD)
+ && known_eq (rtx_to_poly_int64 (XEXP (XVECEXP (src, 0,
+ finish - 1), 1)),
+ bytepos))
{
- temp = simplify_gen_subreg (outer, tmps[finish - 1],
- inner, 0);
+ temp = simplify_gen_subreg (outer, tmps[finish - 1], inner, 0);
if (temp)
{
emit_move_insn (dst, temp);