diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-02-15 09:52:47 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-02-15 09:52:47 +0100 |
commit | baa40971d1600672f3a1abf688905a70cf655c92 (patch) | |
tree | 760775cd2f4c451775f2772794b8ff68a8ae88f2 /gcc/fortran | |
parent | 52ac4c6be8664e9dab5b90e7c64df03985791893 (diff) | |
download | gcc-baa40971d1600672f3a1abf688905a70cf655c92.zip gcc-baa40971d1600672f3a1abf688905a70cf655c92.tar.gz gcc-baa40971d1600672f3a1abf688905a70cf655c92.tar.bz2 |
lower-bitint: Ensure we don't get coalescing ICEs for (ab) SSA_NAMEs used in mul/div/mod [PR113567]
The build_bitint_stmt_ssa_conflicts hook has a special case for
multiplication, division and modulo, where to ensure there is no overlap
between lhs and rhs1/rhs2 arrays we make the lhs conflict with the
operands.
On the following testcase, we have
# a_1(ab) = PHI <a_2(D)(0), a_3(ab)(3)>
lab:
a_3(ab) = a_1(ab) % 3;
before lowering and this special case causes a_3(ab) and a_1(ab) to
conflict, but the PHI requires them not to conflict, so we ICE because we
can't find some partitioning that will work.
The following patch fixes this by special casing such statements before
the partitioning, force the inputs of the multiplication/division which
have large/huge _BitInt (ab) lhs into new non-(ab) SSA_NAMEs initialized
right before the multiplication/division. This allows the partitioning
to work then, as it has the possibility to use a different partition for
the */% operands.
2024-02-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/113567
* gimple-lower-bitint.cc (gimple_lower_bitint): For large/huge
_BitInt multiplication, division or modulo with
SSA_NAME_OCCURS_IN_ABNORMAL_PHI lhs and at least one of rhs1 and rhs2
force the affected inputs into a new SSA_NAME.
* gcc.dg/bitint-90.c: New test.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions