GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
testsuite

Adjust sext-vector-1.c test for lowered vector XORs

Modifies a test case to scan for XOR constants instead of counting XOR operations after vector lowering.

This change updates the sext-vector-1.c test case to scan for XOR constants rather than counting the XOR operations. This is necessary because on -m32 targets, the 8-byte vector is lowered into two halves, resulting in five XORs in the optimized dump instead of the previously expected four. Scanning for constants makes the test robust to these internal representation changes.

In Details

The GCC test gcc.dg/tree-ssa/sext-vector-1.c previously counted XOR instructions in its optimized dump. However, with -m32, the 8-byte vector vq is lowered into two 4-byte halves, leading to an increase in XOR operations from four to five. To maintain test stability across different targets and internal lowering strategies, this commit modifies the test to scan for the specific XOR constants involved rather than relying on a direct count of the XOR instructions.

For Context
sext
Sign-extend. Extending a smaller integer value by replicating its most significant bit to fill the higher-order bits of a larger integer type.
Lowering
The process in a compiler where higher-level intermediate representations are transformed into lower-level ones, closer to machine code.
XOR
Exclusive OR. A bitwise logical operation.
Tree SSA
An intermediate representation used in GCC that combines concepts of Control Dependence Graph (CDG) and Static Single Assignment (SSA) form.
Filed Under: testsuitegcctree-ssavectorization