Skip to content

Commit ed86506

Browse files
GCC: xtensa: backport patch from upstream
this PR relieves the problem (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102115): b552c4e601c7fdc4d341e29cc1ed6081d42b00d0 "gcc: xtensa: fix PR target/102115"
1 parent 6468f61 commit ed86506

4 files changed

+116
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From b552c4e601c7fdc4d341e29cc1ed6081d42b00d0 Mon Sep 17 00:00:00 2001
2+
From: Max Filippov <jcmvbkbc@gmail.com>
3+
Date: Tue, 7 Sep 2021 15:40:00 -0700
4+
Subject: [PATCH] gcc: xtensa: fix PR target/102115
5+
6+
2021-09-07 Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
7+
gcc/
8+
PR target/102115
9+
* config/xtensa/xtensa.c (xtensa_emit_move_sequence): Add
10+
'CONST_INT_P (src)' to the condition of the block that tries to
11+
eliminate literal when loading integer contant.
12+
---
13+
gcc/config/xtensa/xtensa.c | 3 ++-
14+
1 file changed, 2 insertions(+), 1 deletion(-)
15+
16+
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
17+
index f4f8f1975c55a..8d6755144c120 100644
18+
--- a/gcc/config/xtensa/xtensa.c
19+
+++ b/gcc/config/xtensa/xtensa.c
20+
@@ -1084,7 +1084,8 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
21+
{
22+
/* Try to emit MOVI + SLLI sequence, that is smaller
23+
than L32R + literal. */
24+
- if (optimize_size && mode == SImode && register_operand (dst, mode))
25+
+ if (optimize_size && mode == SImode && CONST_INT_P (src)
26+
+ && register_operand (dst, mode))
27+
{
28+
HOST_WIDE_INT srcval = INTVAL (src);
29+
int shift = ctz_hwi (srcval);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From b552c4e601c7fdc4d341e29cc1ed6081d42b00d0 Mon Sep 17 00:00:00 2001
2+
From: Max Filippov <jcmvbkbc@gmail.com>
3+
Date: Tue, 7 Sep 2021 15:40:00 -0700
4+
Subject: [PATCH] gcc: xtensa: fix PR target/102115
5+
6+
2021-09-07 Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
7+
gcc/
8+
PR target/102115
9+
* config/xtensa/xtensa.c (xtensa_emit_move_sequence): Add
10+
'CONST_INT_P (src)' to the condition of the block that tries to
11+
eliminate literal when loading integer contant.
12+
---
13+
gcc/config/xtensa/xtensa.c | 3 ++-
14+
1 file changed, 2 insertions(+), 1 deletion(-)
15+
16+
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
17+
index f4f8f1975c55a..8d6755144c120 100644
18+
--- a/gcc/config/xtensa/xtensa.c
19+
+++ b/gcc/config/xtensa/xtensa.c
20+
@@ -1084,7 +1084,8 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
21+
{
22+
/* Try to emit MOVI + SLLI sequence, that is smaller
23+
than L32R + literal. */
24+
- if (optimize_size && mode == SImode && register_operand (dst, mode))
25+
+ if (optimize_size && mode == SImode && CONST_INT_P (src)
26+
+ && register_operand (dst, mode))
27+
{
28+
HOST_WIDE_INT srcval = INTVAL (src);
29+
int shift = ctz_hwi (srcval);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From b552c4e601c7fdc4d341e29cc1ed6081d42b00d0 Mon Sep 17 00:00:00 2001
2+
From: Max Filippov <jcmvbkbc@gmail.com>
3+
Date: Tue, 7 Sep 2021 15:40:00 -0700
4+
Subject: [PATCH] gcc: xtensa: fix PR target/102115
5+
6+
2021-09-07 Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
7+
gcc/
8+
PR target/102115
9+
* config/xtensa/xtensa.c (xtensa_emit_move_sequence): Add
10+
'CONST_INT_P (src)' to the condition of the block that tries to
11+
eliminate literal when loading integer contant.
12+
---
13+
gcc/config/xtensa/xtensa.c | 3 ++-
14+
1 file changed, 2 insertions(+), 1 deletion(-)
15+
16+
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
17+
index f4f8f1975c55a..8d6755144c120 100644
18+
--- a/gcc/config/xtensa/xtensa.c
19+
+++ b/gcc/config/xtensa/xtensa.c
20+
@@ -1084,7 +1084,8 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
21+
{
22+
/* Try to emit MOVI + SLLI sequence, that is smaller
23+
than L32R + literal. */
24+
- if (optimize_size && mode == SImode && register_operand (dst, mode))
25+
+ if (optimize_size && mode == SImode && CONST_INT_P (src)
26+
+ && register_operand (dst, mode))
27+
{
28+
HOST_WIDE_INT srcval = INTVAL (src);
29+
int shift = ctz_hwi (srcval);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From b552c4e601c7fdc4d341e29cc1ed6081d42b00d0 Mon Sep 17 00:00:00 2001
2+
From: Max Filippov <jcmvbkbc@gmail.com>
3+
Date: Tue, 7 Sep 2021 15:40:00 -0700
4+
Subject: [PATCH] gcc: xtensa: fix PR target/102115
5+
6+
2021-09-07 Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
7+
gcc/
8+
PR target/102115
9+
* config/xtensa/xtensa.c (xtensa_emit_move_sequence): Add
10+
'CONST_INT_P (src)' to the condition of the block that tries to
11+
eliminate literal when loading integer contant.
12+
---
13+
gcc/config/xtensa/xtensa.c | 3 ++-
14+
1 file changed, 2 insertions(+), 1 deletion(-)
15+
16+
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
17+
index f4f8f1975c55a..8d6755144c120 100644
18+
--- a/gcc/config/xtensa/xtensa.c
19+
+++ b/gcc/config/xtensa/xtensa.c
20+
@@ -1084,7 +1084,8 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
21+
{
22+
/* Try to emit MOVI + SLLI sequence, that is smaller
23+
than L32R + literal. */
24+
- if (optimize_size && mode == SImode && register_operand (dst, mode))
25+
+ if (optimize_size && mode == SImode && CONST_INT_P (src)
26+
+ && register_operand (dst, mode))
27+
{
28+
HOST_WIDE_INT srcval = INTVAL (src);
29+
int shift = ctz_hwi (srcval);

0 commit comments

Comments
 (0)