Stack alignment of DC functions

Yuxuan Shui yshuiv7 at gmail.com
Wed Oct 9 21:43:01 UTC 2019


Hi,

When trying to build a Linux kernel with clang, I encountered a GPF
problem in the amdgpu module. Details of the issue can be found here:
https://github.com/ClangBuiltLinux/linux/issues/735

In short, the stack is aligned to 8 bytes while clang assumed the
stack is aligned to 16 bytes (because -mstack-alignment=16 is passed),
and generated an unaligned MOVAPD.

My question is, how is this supposed to work? To my understanding, gcc
option -mpreferred-stack-boundary does not align the stack, it simply
make gcc assume the stack alignment. Passing
-mpreferred-stack-boundary=4 to DC code seems to be wrong since the
actual stack alignment is only 8 bytes. Yet this GPF has not been
observed when compiling the kernel with gcc.

I don't really understand.

-- 

Regards
Yuxuan Shui


More information about the amd-gfx mailing list