Landing: deb5f74feeaf

Project / Subsystem

gcc / c-family

Date

2026-07-14

Author

Jakub Jelinek

Commit

deb5f74feeaf3a43f6d4008a1e01fc4d23c1efdf

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c-family
patch_id
commit_hash
deb5f74feeaf3a43f6d4008a1e01fc4d23c1efdf
source_type
github
headline
c-family: Use CAS loop for small _BitInt atomics with padding.
tldr
Uses CAS loop instead of RMW atomics for small _BitInt types with padding on certain architectures.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c
  • c++
  • atomic
  • bitint
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-07-14T00:00:00.000Z

For small _BitInt types with padding, some atomic/sync builtins that operate on TYPE * arguments do not correctly sign or zero-extend the values. This commit changes the implementation to use a Compare-And-Swap (CAS) loop instead of Read-Modify-Write (RMW) atomics for these specific cases. This ensures correct behavior when the target architecture requires extension into the padding bits, addressing PR124948.