Re: [PATCH] iommu/generic_pt: disable GCOV for iommu_amdv1.o
From: Jason Gunthorpe
Date: Fri Apr 03 2026 - 12:11:44 EST
On Thu, Apr 02, 2026 at 05:10:12PM +0300, Konstantin Khorenko wrote:
> With -fprofile-update=atomic in global CFLAGS_GCOV, GCC cannot
> constant-fold FIELD_PREP() expressions inside deeply inlined page table
> walker functions. GCC creates .constprop clones of the inline level
> functions, which get their own GCOV instrumentation that prevents
> constant evaluation of compile-time checks.
That's hasn't been the issue here. gcc gets confused where it thinks a
value is constant so the builtin_constant checks inside FIELD_PREP
trigger, but if the value is constant then control flow leading up to
it excludes that path ever happening.
Somehow gcov is breaking the elimination of the impossible branch, and
I think this is all just compiler bugs.
Also, I thought this was fixed by adding the always_inline?
Jason