]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Fix ICE due to aarch64_gen_compare_reg_maybe_ze [PR94435]
authorJakub Jelinek <jakub@redhat.com>
Thu, 2 Apr 2020 10:54:47 +0000 (12:54 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 2 Apr 2020 10:59:11 +0000 (12:59 +0200)
commitbe64fc4cab7facee309447302b6ee7616dfe60b4
treef226f2a6a1708120601b3134e0338d87fe87a35a
parentb6e546912555c9b9b27bdce516e98546f4cd3d25
aarch64: Fix ICE due to aarch64_gen_compare_reg_maybe_ze [PR94435]

The following testcase ICEs, because aarch64_gen_compare_reg_maybe_ze emits
invalid RTL.
For y_mode [QH]Imode it expects y to be of that mode (or CONST_INT that fits
into that mode) and x being SImode; for non-CONST_INT y it zero extends y
into SImode and compares that against x, for CONST_INT y it zero extends y
into SImode.  The problem is that when the zero extended constant isn't
usable directly, it forces it into a REG, but with y_mode mode, and then
compares against y.  That is wrong, because it should force it into a SImode
REG and compare that way.

2020-04-02  Jakub Jelinek  <jakub@redhat.com>

PR target/94435
* config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): For
y_mode E_[QH]Imode and y being a CONST_INT, change y_mode to SImode.

* gcc.target/aarch64/pr94435.c: New test.
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/pr94435.c [new file with mode: 0644]