GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
risc-v

RISC-V: Fix bootstrap issue with `__NORMAL_OP_TA2`

RISC-V bootstrap is fixed by casting `__NORMAL_OP_TA2` to unsigned in `shuffle_interleave_even_odd_patterns`.

This commit addresses a RISC-V bootstrap issue by correcting the usage of __NORMAL_OP_TA2 in the shuffle_interleave_even_odd_patterns function. Previously, using this flag directly with BINARY_OP_P caused a compiler warning. The fix involves casting __NORMAL_OP_TA2 to an unsigned type, similar to its usage in expand_const_vector_onestep, resolving the warning and ensuring a clean bootstrap.

In Details

This change targets a bootstrapping problem on the RISC-V target, specifically within gcc/config/riscv/riscv-v.cc. The function shuffle_interleave_even_odd_patterns was incorrectly using __NORMAL_OP_TA2 | BINARY_OP_P. The issue arises from the implicit integer promotion rules when combining flags. By casting __NORMAL_OP_TA2 to unsigned, the operation behaves consistently with expand_const_vector_onestep, which uses (unsigned)__NORMAL_OP_TA2, thus avoiding a bootstrap warning and ensuring correct flag combination for vector operations.

For Context
RISC-V
An open-standard instruction set architecture (ISA) based on Reduced Instruction Set Computing principles.
bootstrap
The process of building a compiler using an earlier version of itself. It's a critical step in ensuring the compiler can be self-hosted and that new versions can be built reliably.
__NORMAL_OP_TA2
A flag used in RISC-V vector extension patterns to indicate a specific type of operation, likely related to arithmetic or data movement.
vector extension
An optional set of instructions for the RISC-V architecture that enables Single Instruction, Multiple Data (SIMD) operations for accelerated processing of multiple data elements.
Filed Under: risc-vbootstrapvectorization