]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Use simplify_gen_subreg instead of gen_rtx_SUBREG in loongarch_expand_vec_...
authorXi Ruoyao <xry111@xry111.site>
Sat, 11 Nov 2023 16:55:13 +0000 (00:55 +0800)
committerXi Ruoyao <xry111@xry111.site>
Mon, 13 Nov 2023 06:15:06 +0000 (14:15 +0800)
commitb88500e0bc1e9e3a396ba764f9b701d22a76818f
treef887fcdb6ebf8e04a11e1305aa0e8982f5b193c0
parent401dc18184af6b32a3ccbe1eaeed0c7ff9ae1d5a
LoongArch: Use simplify_gen_subreg instead of gen_rtx_SUBREG in loongarch_expand_vec_cond_mask_expr [PR112476]

GCC internal says:

    'subreg's of 'subreg's are not supported.  Using
    'simplify_gen_subreg' is the recommended way to avoid this problem.

Unfortunately loongarch_expand_vec_cond_mask_expr might create nested
subreg under certain circumstances, causing an ICE.

Use simplify_gen_subreg as the internal document suggests.

gcc/ChangeLog:

PR target/112476
* config/loongarch/loongarch.cc
(loongarch_expand_vec_cond_mask_expr): Call simplify_gen_subreg
instead of gen_rtx_SUBREG.

gcc/testsuite/ChangeLog:

PR target/112476
* gcc.target/loongarch/pr112476-1.c: New test.
* gcc.target/loongarch/pr112476-2.c: New test.
gcc/config/loongarch/loongarch.cc
gcc/testsuite/gcc.target/loongarch/pr112476-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/pr112476-2.c [new file with mode: 0644]