]> gcc.gnu.org Git - gcc.git/commit
bitint: Handle complex types in build_bitint_stmt_ssa_conflicts [PR114425]
authorJakub Jelinek <jakub@redhat.com>
Sat, 23 Mar 2024 10:19:09 +0000 (11:19 +0100)
committerJakub Jelinek <jakub@redhat.com>
Sat, 23 Mar 2024 10:19:09 +0000 (11:19 +0100)
commitf92cf8cbbe199bda70d0dd7893e8c8836777e2d0
treed725407a317f5462aae1e5d0b8a770a3b32afadd
parent8fc5593df8e0d36cc5bd8ea21097a491a634a866
bitint: Handle complex types in build_bitint_stmt_ssa_conflicts [PR114425]

The task of the build_bitint_stmt_ssa_conflicts hook for
tree-ssa-coalesce.cc next to special casing the
multiplication/division/modulo is to ignore statements with
large/huge _BitInt lhs which isn't in names bitmap and on the
other side pretend all uses of the stmt are used in a later stmt
(single user of that SSA_NAME or perhaps single user of lhs of
the single user etc.) where the lowering will actually emit the
code.

Unfortunately the function wasn't handling COMPLEX_TYPE of the large/huge
BITINT_TYPE, while the FE doesn't really support such types, they are
used under the hood for __builtin_{add,sub,mul}_overflow{,_p}, they are
also present or absent from the names bitmap and should be treated the same.

Without this patch, the operands of .ADD_OVERFLOW were incorrectly pretended
to be used right in that call statement rather than on the cast stmt from
IMAGPART_EXPR of .ADD_OVERFLOW return value to some integral type.

2024-03-23  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/114425
* gimple-lower-bitint.cc (build_bitint_stmt_ssa_conflicts): Handle
_Complex large/huge _BitInt types like the large/huge _BitInt types.

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