aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2021-05-18 15:45:54 +0200
committerUros Bizjak <ubizjak@gmail.com>2021-05-18 15:46:32 +0200
commitd39fbed75810fc7478842503ecb0268b85dc9c2e (patch)
treecab63b7dda8c3365ef476bd78120dd8ab8a43d62 /gcc
parentd3a0208e433dc5aed7ef8deab8d74b6da55e1985 (diff)
downloadgcc-d39fbed75810fc7478842503ecb0268b85dc9c2e.zip
gcc-d39fbed75810fc7478842503ecb0268b85dc9c2e.tar.gz
gcc-d39fbed75810fc7478842503ecb0268b85dc9c2e.tar.bz2
i386: Fix split_double_mode with paradoxical subreg [PR100626]
split_double_mode calls simplify_gen_subreg, which fails for the high half of the paradoxical subreg. Return temporary register instead of NULL RTX in this case. 2021-05-18 Uroš Bizjak <ubizjak@gmail.com> gcc/ PR target/100626 * config/i386/i386-expand.c (split_double_mode): Return temporary register when simplify_gen_subreg fails with the high half od the paradoxical subreg.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/i386-expand.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 0fa8d45..9f3d419 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -154,9 +154,13 @@ split_double_mode (machine_mode mode, rtx operands[],
lo_half[num] = simplify_gen_subreg (half_mode, op,
GET_MODE (op) == VOIDmode
? mode : GET_MODE (op), 0);
- hi_half[num] = simplify_gen_subreg (half_mode, op,
- GET_MODE (op) == VOIDmode
- ? mode : GET_MODE (op), byte);
+
+ rtx tmp = simplify_gen_subreg (half_mode, op,
+ GET_MODE (op) == VOIDmode
+ ? mode : GET_MODE (op), byte);
+ /* simplify_gen_subreg will return NULL RTX for the
+ high half of the paradoxical subreg. */
+ hi_half[num] = tmp ? tmp : gen_reg_rtx (half_mode);
}
}
}