GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
aarch64

aarch64: Fixes for 'overflow' instruction patterns improve code generation.

Aarch64 instruction patterns for overflow checks with MINUS and NEG were corrected, fixing an ICE and improving optimization.

This commit rectifies several issues with AArch64 ‘overflow’ instruction patterns, specifically for MINUS and NEG operations. It corrects the selection of the CCmode for overflow checks, ensures patterns are in canonical form for better optimization by the ‘combine’ pass, and fixes an invalid output template that caused an ICE.

In Details

The aarch64 backend's instruction selection and optimization for arithmetic operations with overflow detection has been improved. Previously, MINUS and NEG overflow checks were not correctly handled, leading to fallback to CCmode and preventing optimizations. Canonicalization of patterns in aarch64.md and fixing an output template in subv<GPI:mode>4_insn and negv<GPI:mode>_insn resolve these issues, preventing an ICE and enabling the use of these patterns.

For Context
CCmode
A mode used in GCC's internal representation to signify a condition code, often used for comparisons and conditional operations.
canonical form
A standardized representation of an expression or pattern that allows optimization passes to reliably match and transform them.
ICE
Internal Compiler Error. A condition where the compiler encounters an unrecoverable error during its execution, typically due to a bug.
Filed Under: aarch64optimizationbugfix