https://bugs.kde.org/show_bug.cgi?id=523626

--- Comment #15 from Mark Wielaard <[email protected]> ---
(In reply to mcermak from comment #14)
> https://clang.llvm.org/docs/AttributeReference.html#force-align-arg-pointer :
> 
> > Legacy x86 code uses 4-byte stack alignment. Newer aligned SSE instructions
> > (like ‘movaps’) that work with the stack require operands to be 16-byte 
> > aligned.
> > This attribute realigns the stack in the function prologue to make sure the 
> > stack
> > can be used with SSE instructions.
> >
> > Note that the x86_64 ABI forces 16-byte stack alignment at the call site. 
> > Because
> > of this, ‘force_align_arg_pointer’ is not needed on x86_64, except in rare 
> > cases
> > where the caller does not align the stack properly (e.g. flow jumps from 
> > i386 arch code).
> 
> ... so maybe __attribute__((force_align_arg_pointer)) actually is the proper
> fix to this issue?

O that is great. GCC has the same attribute:
https://gcc.gnu.org/onlinedocs/gcc/x86-Attributes.html#index-force_005falign_005farg_005fpointer_002c-x86

So yes, that is the proper workaround for this issue.

But I think the real issue is that for x86 helper calls doHelperCall doesn't
align the stack to 16 bytes.

I recommend adding __attribute__((force_align_arg_pointer)) to g_calc_mpsadbw
#if defined(VGA_x86)
to solve this issue.

But also create a new bug to fix doHelperCall in VEX/priv/host_x86_isel.c to
make sure the stack is aligned
to 16 bytes for clean helper calls because this might otherwise happen again if
some optimization requires
that for any other clean helper function.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to