GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
aarch64

Relax type-checking for aarch64 NEON builtins

Fixes an assertion failure in aarch64 NEON builtins by using a more robust type comparison.

This commit addresses an assertion failure in the aarch64 NEON builtins related to type checking. The issue occurred when comparing arg_type with TREE_TYPE(b) by pointer address, which failed if one type was a typedef for another (e.g., uint32x2_t and __Uint32x2_t). The fix replaces the strict pointer comparison with types_compatible_p, providing a more lenient and correct type comparison.

In Details

In config/aarch64/aarch64-neon-builtins-base.cc, the comparison between arg_type and TREE_TYPE(b) within the context of NEON built-in functions was previously a direct pointer comparison. This commit changes it to use types_compatible_p(arg_type, TREE_TYPE(b)). This function correctly handles type compatibility, including cases where types are defined via typedef, thus resolving the PR126064 assertion failure.

For Context
aarch64
A 64-bit ARM architecture, commonly used in mobile devices and servers.
NEON
An ARM Advanced SIMD (Single Instruction, Multiple Data) extension providing a set of instructions for accelerating data processing tasks, often used for multimedia and signal processing.
typedef
A keyword in C and C++ that creates an alias for an existing type. For example, typedef int integer; makes integer a synonym for int.
TREE_TYPE
In GCC's internal representation (GIMPLE/TREE), this macro retrieves the type information associated with a tree node.
Filed Under: aarch64neonbuiltinstypedef