aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorJørgen Kvalsvik <j@lambda.is>2024-04-08 15:19:55 +0200
committerJørgen Kvalsvik <j@lambda.is>2024-04-09 09:57:42 +0200
commita2447556a5405d2cde20afc134b90cd1d199ce04 (patch)
treeff9cb68046913db08c85b4332554a204f28b20dc /gcc/rust
parent2daeb89d6f025d6daf7e560575863b3280120be8 (diff)
Generate constant at start of loop, without UB
Generating the constants used for recording the edges taken for condition coverage would trigger undefined behavior when an expression had exactly 64 (== sizeof (1ULL)) conditions, as it would generate the constant for the next iteration at the end of the loop body, even if there was never a next iteration. By moving the check and constant generation to the top of the loop and hoisting the increment flag there is no opportunity for UB. PR middle-end/114627 gcc/ChangeLog: * tree-profile.cc (instrument_decisions): Generate constant at the start of loop.
Diffstat (limited to 'gcc/rust')
0 files changed, 0 insertions, 0 deletions