[cfe-dev] Is force_align_arg_pointer function attribute supported at x86?

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Thu Jun 22 08:03:14 PDT 2017


On Wed, Jun 21, 2017 at 02:21:45PM -0700, Anatol Pomozov via cfe-dev wrote:
> I tried to do this in my 32-bit code
>     __asm__ volatile("and %0, %%esp"::"irm"(-16));
>     __asm__ volatile("jmp %0, %1" ::"i"(CODE_SELECTOR), "p"(start_64));
> that compiled into
> 
> "and $0xfffffff0,%esp"
> jmp $SELECTOR,start_64
> 
> but it does not provide the correct stack alignment.

Depending on the exact position in the calling sequence, you actually
want to subtract 8 after the AND.

Joerg



More information about the cfe-dev mailing list