Landing: a171c89fbf67

Project / Subsystem

gcc / bitmap

Date

2026-05-25

Author

Richard Sandiford

Commit

a171c89fbf6720bf8562b2e0121e582fbadd5e50

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
bitmap
patch_id
commit_hash
a171c89fbf6720bf8562b2e0121e582fbadd5e50
source_type
github
headline
Fix missing last bit read in bitmap_last_set_bit function
tldr
The `bitmap_last_set_bit` function now correctly identifies the last set bit in a bitmap, preventing it from missing the last bit in the first element.
author
Richard Sandiford
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • gcc
  • bitmap
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-05-25T00:00:00.000Z

The bitmap_last_set_bit function in bitmap.cc had a flaw where it would not correctly read the last bit if it happened to be in the first element of the bitmap. This could lead to incorrect results when searching for the last set bit. The fix ensures that the function now correctly handles this case, using a structure similar to bitmap_first_set_bit_worker to iterate through the bitmap.