]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: PR target/108140 Handle NULL target in data intrinsic expansion
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Mon, 19 Dec 2022 11:16:47 +0000 (11:16 +0000)
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 10 Jan 2023 10:24:53 +0000 (10:24 +0000)
commit849c3cf7b4189342b4a0df941afddf8327585570
tree4ac40b3ec12a798ccb1179d6b9f4d943c074bcd6
parent56314aa33a46224bbe070f8cddb7dda2a5aea747
aarch64: PR target/108140 Handle NULL target in data intrinsic expansion

In this PR we ICE when expanding the __rbit builtin with a NULL target rtx.
I *think* that only happens when the result is unused and hence maybe we shouldn't be expanding
any RTL at all, but the ICE here is easily fixed by deriving the mode from the type of the expression
rather than the target.

This patch does that.
Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/ChangeLog:

PR target/108140
* config/aarch64/aarch64-builtins.cc
(aarch64_expand_builtin_data_intrinsic): Handle NULL target.

gcc/testsuite/ChangeLog:

PR target/108140
* gcc.target/aarch64/acle/pr108140.c: New test.

(cherry picked from commit 98756bcbe27647f263f2b312d1d933d70cf56ba9)
gcc/config/aarch64/aarch64-builtins.cc
gcc/testsuite/gcc.target/aarch64/acle/pr108140.c [new file with mode: 0644]