-
- Downloads
lower-bitint: Fix lowering of middle sized _BitInt operations which can throw [PR112770]
The middle kind _BitInt lowering is mostly done by casting the BITINT_TYPE operands (if any) to a signed/unsigned integer type which has larger/equal precision, using such integer type also for the lhs (if BITINT_TYPE) and and adding a cast after the statement from that new lhs to the old (BITINT_TYPE) lhs. Note, for middle kind this isn't done for GIMPLE_CALLs. Most of the time that works nicely, the exception as the following testcase shows is -fnon-call-exceptions and some operations which can trap. Because inserting the cast to a new lhs after the statement results in a trapping statement in the middle of a basic block. The following patch fixes that by emitting the cast on the fallthru edge instead. 2023-12-01 Jakub Jelinek <jakub@redhat.com> PR middle-end/112770 * gimple-lower-bitint.cc (gimple_lower_bitint): When adjusting lhs of middle _BitInt setter which ends bb, insert cast on the fallthru edge rather than after stmt. * gcc.dg/bitint-45.c: New test.
Loading
Please register or sign in to comment