From: Max Filippov Date: Tue, 7 Sep 2021 22:40:00 +0000 (-0700) Subject: gcc: xtensa: fix PR target/102115 X-Git-Tag: basepoints/gcc-13~4911 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b552c4e601c7fdc4d341e29cc1ed6081d42b00d0;p=thirdparty%2Fgcc.git gcc: xtensa: fix PR target/102115 2021-09-07 Takayuki 'January June' Suwa 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. --- diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index f4f8f1975c55..8d6755144c12 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);