aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2021-09-07 15:40:00 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2021-09-07 15:40:26 -0700
commitb552c4e601c7fdc4d341e29cc1ed6081d42b00d0 (patch)
treed748386dadd4ebfee78107512ac5ec20e5520546
parent21b046bade1c2666b82139d18c8b318bb051415e (diff)
downloadgcc-b552c4e601c7fdc4d341e29cc1ed6081d42b00d0.zip
gcc-b552c4e601c7fdc4d341e29cc1ed6081d42b00d0.tar.gz
gcc-b552c4e601c7fdc4d341e29cc1ed6081d42b00d0.tar.bz2
gcc: xtensa: fix PR target/102115
2021-09-07 Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp> gcc/ PR target/102115 * config/xtensa/xtensa.c (xtensa_emit_move_sequence): Add 'CONST_INT_P (src)' to the condition of the block that tries to eliminate literal when loading integer contant.
-rw-r--r--gcc/config/xtensa/xtensa.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index f4f8f19..8d67551 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -1084,7 +1084,8 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
{
/* Try to emit MOVI + SLLI sequence, that is smaller
than L32R + literal. */
- if (optimize_size && mode == SImode && register_operand (dst, mode))
+ if (optimize_size && mode == SImode && CONST_INT_P (src)
+ && register_operand (dst, mode))
{
HOST_WIDE_INT srcval = INTVAL (src);
int shift = ctz_hwi (srcval);