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

Fix ICE on discarded intrinsic result in AArch64 intrinsics

Resolves an internal compiler error when discarding intrinsic results.

This commit fixes an ICE in the AArch64 backend that occurred when an intrinsic’s result was discarded. The issue stemmed from using a temporary variable as a placeholder LHS, which led to incorrect SSA updates. The fix introduces a lhs member function and a ret_type member to the gimple_folder, ensuring proper handling of discarded results and preventing ICEs, while also improving the handling of aggregate types.

In Details

This patch addresses PR target/127771 concerning an ICE in AArch64 intrinsics. The problem arose because a discarded intrinsic result was being assigned to a placeholder VAR_DECL created by create_tmp_var. This incorrectly set ssa_renaming_needed without subsequent folding passes updating TODO_update_ssa, leading to an ICE in execute_todo. The fix refactors gimple_folder to use a member function lhs and a new ret_type member. The lhs function now handles creating the destination and ensuring it's an SSA name for register types, and ret_type is directly taken from the funct…

For Context
ICE
Internal Compiler Error. A situation where the compiler encounters an unrecoverable condition during compilation and terminates.
Intrinsic
A special function provided by the compiler that maps directly to a specific machine instruction or a small sequence of instructions, often for performance-critical operations.
GIMPLE
GCC's internal representation (IR) used after the front-end has parsed the source code. It's a three-address-like code that simplifies many optimization passes.
SSA
Static Single Assignment form. A program representation where every variable is assigned exactly once. This simplifies many dataflow analyses and optimizations. GIMPLE often uses SSA form.
DCE
Dead Code Elimination. An optimization pass that removes code that does not affect the program's output.
Filed Under: aarch64gcciceintrinsicsoptimization