GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
i386

i386: Disable PIE for tests using check_function_bodies due to PIE incompatibilities.

Several i386 tests using `check_function_bodies` now disable PIE to avoid mismatches in expected function body output.

Several i386 testsuite tests that use check_function_bodies now explicitly disable Position Independent Executable (PIE) generation. These tests compare the actual generated assembly of a function against a pre-defined expected output, and PIE can cause slight variations in the generated code (e.g., different address calculation syntax, extra “@PLT” symbols) that cause the tests to fail. The -fno-pie option is added to the testsuite directives to prevent this issue and ensure the tests execute correctly. This addresses PR testsuite/70150.

In Details

The affected test cases use check_function_bodies to verify the generated assembly code. PIE can introduce variations in the assembly output due to the use of PC-relative addressing and PLT entries. By adding -fno-pie to the dg-options, the tests are compiled without PIE, ensuring that the generated assembly matches the expected output. The commit touches tests in gcc.target/i386/ and g++.target/i386/.

For Context

Position Independent Executables (PIE) are a security feature where programs can be loaded at different memory addresses. However, the generated machine code can differ slightly depending on whether PIE is enabled or not. check_function_bodies is a testsuite feature that compares the compiler's output against expected assembly code. This commit disables PIE for tests where the expected output is not PIE-compatible, avoiding false negatives.

Filed Under: i386testsuitepie