]> git.ipfire.org Git - thirdparty/gcc.git/commit
expand: Fix ICE in store_bit_field_using_insv [PR93235]
authorJakub Jelinek <jakub@redhat.com>
Thu, 4 Mar 2021 18:38:08 +0000 (19:38 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 22 Apr 2021 14:44:41 +0000 (16:44 +0200)
commit35936ba22c8e51c93c87e47114e194a84f9c9ba9
tree1fb926200131d740da617effa1b6ad0855361b4c
parentcfe0485ff571a7cd27d2c1115f1fea1a5fecc17c
expand: Fix ICE in store_bit_field_using_insv [PR93235]

The following testcase ICEs on aarch64.  The problem is that
op0 is (subreg:HI (reg:HF ...) 0) and because we can't create a SUBREG of a
SUBREG and aarch64 doesn't have HImode insv, only SImode insv,
store_bit_field_using_insv tries to create (subreg:SI (reg:HF ...) 0)
which is not valid for the target and so gen_rtx_SUBREG ICEs.

The following patch fixes it by punting if the to be created SUBREG
doesn't validate, callers of store_bit_field_using_insv can handle
the fallback.

2021-03-04  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/93235
* expmed.c (store_bit_field_using_insv): Return false of xop0 is a
SUBREG and a SUBREG to op_mode can't be created.

* gcc.target/aarch64/pr93235.c: New test.

(cherry picked from commit 510ff5def87c70836fdbf832228661ae28e524b6)
gcc/expmed.c
gcc/testsuite/gcc.target/aarch64/pr93235.c [new file with mode: 0644]