]> gcc.gnu.org Git - gcc.git/commit
lower-bitint: Fix up lowering of huge _BitInt 0 PHI args [PR113120]
authorJakub Jelinek <jakub@redhat.com>
Mon, 8 Jan 2024 12:58:28 +0000 (13:58 +0100)
committerJakub Jelinek <jakub@redhat.com>
Mon, 8 Jan 2024 12:58:28 +0000 (13:58 +0100)
commitefef8d7ff43c6c489fd6e7c52d71494d21324c87
treed25d5883fdc1e4c6247ed02e770f781cbc7c70e6
parent7590d975ecfdae4f112b5086c017101c08f07e3e
lower-bitint: Fix up lowering of huge _BitInt 0 PHI args [PR113120]

The PHI argument expansion of INTEGER_CSTs where bitint_min_cst_precision
returns significantly smaller precision than the PHI result precision is
optimized by loading the much smaller constant (if any) from memory and
then either setting the remaining limbs to {} or calling memset with -1.
The case where no constant is loaded (i.e. c == NULL) is when the
INTEGER_CST is 0 or all_ones - in that case we can just set all the limbs
to {} or call memset with -1 on everything.
While for the all ones extension case that is what the code was already
doing, I missed one spot in the zero extension case, where constricting
the offset of the MEM_REF lhs of the = {} store it was using unconditionally
the byte size of c, which obviously doesn't work if c is NULL.  In that case
we want to use zero offset.

2024-01-08  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/113120
* gimple-lower-bitint.cc (gimple_lower_bitint): Fix handling of very
large _BitInt zero INTEGER_CST PHI argument.

* gcc.dg/bitint-62.c: New test.
gcc/gimple-lower-bitint.cc
gcc/testsuite/gcc.dg/bitint-62.c [new file with mode: 0644]
This page took 0.061518 seconds and 5 git commands to generate.