]> git.ipfire.org Git - thirdparty/gcc.git/commit
bitint: Handle m_bitfld_load cast in outer m_cast_conditional [PR114555]
authorJakub Jelinek <jakub@redhat.com>
Thu, 4 Apr 2024 08:47:00 +0000 (10:47 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 4 Apr 2024 08:47:00 +0000 (10:47 +0200)
commit48530efdcccb154d3ed200246384edc162debc5d
tree2fc7bc0ce0de9d0b087ba05737ed687b63511e0f
parentf2ccfb2d0b2698e6b140e4d09e53b701a3193384
bitint: Handle m_bitfld_load cast in outer m_cast_conditional [PR114555]

We ICE on the following testcase, because we use result of a PHI node
which is only conditional because of a m_cast_conditional on the outermost
loops PHI node argument and so is invalid SSA form.

The following patch fixes it like similar cases elsewhere by adding
needed intervening PHI(s).

2024-04-04  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/114555
* gimple-lower-bitint.cc (bitint_large_huge::handle_cast): For
m_bitfld_load and save_cast_conditional add any needed PHIs
and adjust t4 accordingly.

* gcc.dg/bitint-103.c: New test.
* gcc.dg/bitint-104.c: New test.
gcc/gimple-lower-bitint.cc
gcc/testsuite/gcc.dg/bitint-103.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/bitint-104.c [new file with mode: 0644]