aboutsummaryrefslogtreecommitdiff
path: root/gcc/fibonacci_heap.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-09-30 11:28:44 +0200
committerJakub Jelinek <jakub@redhat.com>2023-09-30 11:28:44 +0200
commit09b512466ce302833d1624045fc5fe5afe040f58 (patch)
treeeaa89d3f61c10e9127ea3f340b2b39e573ce065c /gcc/fibonacci_heap.h
parent9d249b7e31eb4e1379a45f90949776c11d29063c (diff)
downloadgcc-09b512466ce302833d1624045fc5fe5afe040f58.zip
gcc-09b512466ce302833d1624045fc5fe5afe040f58.tar.gz
gcc-09b512466ce302833d1624045fc5fe5afe040f58.tar.bz2
lowerbitint: Fix 2 bitint lowering bugs [PR111625]
This patch fixes 2 issues. One is when we want to get address of an uninitialized large/huge bitint SSA_NAME for multiplication/division/modulo or conversion to floating point (binary or decimal), the code just creates an uninitialized limb sized variable and passes address of that, but I forgot to initialize *prec in that case, so it invoked UB at compile time rather than at runtime. As it is UB, we could use anything valid as precision there, say 2 bits for signed, 1 bit for unsigned as smallest possible set of values, or full bitint precision as full random value. Though, because we only pass address to a single limb, I think it is best to pass the bitsize of the limb. And the other issue is that when ranger in range_to_prec finds some range is undefined_p (), it will assert {lower,upper}_bound () method isn't called on it, but we were. So, the patch adjusts range_to_proc to treat it like the !optimized case, full bitint precision. 2023-09-30 Jakub Jelinek <jakub@redhat.com> PR middle-end/111625 PR middle-end/111637 * gimple-lower-bitint.cc (range_to_prec): Use prec or -prec if r.undefined_p (). (bitint_large_huge::handle_operand_addr): For uninitialized operands use limb_prec or -limb_prec precision.
Diffstat (limited to 'gcc/fibonacci_heap.h')
0 files changed, 0 insertions, 0 deletions