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

i386: Disable AES, SHA, and PCLMUL when SSE2 is disabled.

Disabling SSE2 now correctly disables dependent AES, SHA, and PCLMUL instructions on i386.

This commit fixes a bug on the i386 architecture where the AES, SHA, and PCLMUL instruction sets remained enabled even when SSE2 was explicitly disabled via compiler flags like -mno-sse2. These instruction sets depend on SSE2, and disabling SSE2 should have disabled them. The fix adds these instruction sets to the SSE2 unset mask, ensuring that disabling SSE2 also disables its dependents, preventing the compiler from attempting to use SSE-unavailable instructions.

In Details

Corrects an issue in gcc/common/config/i386/i386-common.cc where OPTION_MASK_ISA_SSE2_UNSET did not clear the AES, SHA, and PCLMUL instruction set options. These ISAs depend on SSE2, and their presence when SSE2 is disabled can lead to incorrect code generation. The commit adds OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_SHA_UNSET, and OPTION_MASK_ISA_PCLMUL_UNSET to the SSE2 unset mask. A new test case pr128105.c is added.

For Context
i386
The original 32-bit Intel x86 architecture and instruction set.
SSE2
Streaming SIMD Extensions 2. A set of instructions for the x86 architecture that enhance multimedia and floating-point processing capabilities. It introduced 128-bit registers.
AES
Advanced Encryption Standard. A cryptographic algorithm. The x86 architecture includes instructions to accelerate AES operations.
SHA
Secure Hash Algorithm. A family of cryptographic hash functions. The x86 architecture includes instructions to accelerate SHA operations.
PCLMUL
Packed Carry-Less Multiplication. An instruction set extension for x86 that accelerates carry-less multiplication, often used in cryptography and error correction codes.
ISA
Instruction Set Architecture. The part of the processor architecture visible to the assembly language programmer or compiler writer.
Filed Under: i386sse2cryptographycompiler bug