diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-01-17 14:43:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-01-17 14:43:40 +0100 |
commit | 9f8ba332e988fb582f6ca32465f6d65283f53b3a (patch) | |
tree | d15e786236838c5ed728b12e52080cff06ccf7bf /gcc/cp | |
parent | a98a24ac65c1a0ee598e5b54d9e4c921a9744a08 (diff) | |
download | gcc-9f8ba332e988fb582f6ca32465f6d65283f53b3a.zip gcc-9f8ba332e988fb582f6ca32465f6d65283f53b3a.tar.gz gcc-9f8ba332e988fb582f6ca32465f6d65283f53b3a.tar.bz2 |
lower-bitint: Avoid overlap between destinations and sources in libgcc calls [PR113421]
The following testcase is miscompiled because the bitint lowering emits a
.MULBITINT (&a, 1024, &a, 1024, &x, 1024);
call. The bug is in the overlap between the destination and source, that is
something the libgcc routines don't handle, they use the source arrays
during the entire algorithms which computes the destination array(s).
For the mapping of SSA_NAMEs to VAR_DECLs the code already supports that
correctly, but the checking whether a load from memory can be used directly
without a temporary even when earlier we decided to merge the
multiplication/division/modulo etc. with a store didn't.
The following patch implements that.
2024-01-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/113421
* gimple-lower-bitint.cc (stmt_needs_operand_addr): Adjust function
comment.
(bitint_dom_walker::before_dom_children): Add g temporary to simplify
formatting. Start at vop rather than cvop even if stmt is a store
and needs_operand_addr.
* gcc.dg/torture/bitint-50.c: New test.
Diffstat (limited to 'gcc/cp')
0 files changed, 0 insertions, 0 deletions