Skip to content

Commit

Permalink
gcc: xtensa: fix PR target/102115
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit b552c4e)
  • Loading branch information
jcmvbkbc authored and antmak committed May 11, 2022
1 parent 3df11f2 commit e74582e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcc/config/xtensa/xtensa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,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);
Expand Down

0 comments on commit e74582e

Please sign in to comment.