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.
This commit is contained in:
Max Filippov 2021-09-07 15:40:00 -07:00
parent 21b046bade
commit b552c4e601

View file

@ -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);