GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

RISC-V: Fix sync builtins unspec->unspecv.

This commit corrects the RISC-V sync builtins by moving and renaming atomic unspec enums to the unspecv enum.

This commit addresses an issue with the RISC-V sync builtins by relocating and renaming atomic unspec enums to the unspecv enum. This change involves modifications to sync.md, sync-rvwmo.md, and sync-ztso.md, ensuring consistency and proper functionality of atomic operations on the RISC-V architecture.

In Details

The patch moves and renames atomic unspec enums to the unspecv enum in config/riscv/sync.md, and updates sync-rvwmo.md and sync-ztso.md to use the renamed UNSPECV_$NAME enums. This corrects the handling of atomic builtins for RISC-V.

For Context

This commit relates to the RISC-V architecture support within GCC. Sync builtins are compiler-provided functions that allow for atomic operations, which are crucial for writing thread-safe code. The unspec and unspecv enums are used internally by the compiler to represent specific operations without exposing low-level details. This commit ensures that these internal representations are correctly defined and used for RISC-V, leading to more reliable atomic operations.

Filed Under: risc-vatomicbuiltinssynchronization