Skip to content

Backport #18532 to 2.2: Fix aarch64 build failure by removing earlyclobber#18671

Open
alex-moch wants to merge 1 commit into
openzfs:zfs-2.2.11-stagingfrom
alex-moch:aarch64-earlyclobber-2.2.11
Open

Backport #18532 to 2.2: Fix aarch64 build failure by removing earlyclobber#18671
alex-moch wants to merge 1 commit into
openzfs:zfs-2.2.11-stagingfrom
alex-moch:aarch64-earlyclobber-2.2.11

Conversation

@alex-moch

Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

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 behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants