Backport #18532 to 2.2: Fix aarch64 build failure by removing earlyclobber#18671
Open
alex-moch wants to merge 1 commit into
Open
Backport #18532 to 2.2: Fix aarch64 build failure by removing earlyclobber#18671alex-moch wants to merge 1 commit into
alex-moch wants to merge 1 commit into
Conversation
The UVR macros used "+&w" (read-write + earlyclobber) as the
constraint for NEON register operands that are declared as explicit
hard-register variables via:
register unsigned char wN asm("vN") __attribute__((vector_size(16)));
The + modifier implicitly makes the operand also an input (reading the
register before the asm runs). The & (earlyclobber) modifier says "this
output may be written before all inputs are consumed." Having an
earlyclobber output on the same hard-register that is simultaneously
an input is a contradiction — GCC 16 now strictly diagnoses this.
The fix removes the & from "+&w", yielding "+w". The earlyclobber
was both incorrect (contradicts the implicit input) and unnecessary
(the physical registers are already hard-bound, so the compiler has no
freedom to assign conflicting registers anyway).
Issue openzfs#18525
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
(cherry picked from commit 3800525)
Signed-off-by: Alexander Moch <mail@alexmoch.com>
behlendorf
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The UVR macros used "+&w" (read-write + earlyclobber) as the constraint for NEON register operands that are declared as explicit hard-register variables via:
register unsigned char wN asm("vN") attribute((vector_size(16)));
The + modifier implicitly makes the operand also an input (reading the register before the asm runs). The & (earlyclobber) modifier says "this output may be written before all inputs are consumed." Having an earlyclobber output on the same hard-register that is simultaneously an input is a contradiction — GCC 16 now strictly diagnoses this.
The fix removes the & from "+&w", yielding "+w". The earlyclobber was both incorrect (contradicts the implicit input) and unnecessary (the physical registers are already hard-bound, so the compiler has no freedom to assign conflicting registers anyway).
Motivation and Context
The corresponding pull request #18532 was not backported to 2.2.10 and fails to build with GCC 16 on AArch64.
Description
Clean cherry-pick from 3800525.
How Has This Been Tested?
Tested on Gentoo with Linux 6.12.93 and GCC 16.1.0 on AArch64 with root on ZFS. No issues.
Types of changes
Checklist:
Signed-off-by.