public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [QUESTION] Stack alignment in Extended Asm Blocks
@ 2021-09-04  1:47 Commeownist
  2021-09-04 13:33 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Commeownist @ 2021-09-04  1:47 UTC (permalink / raw)
  To: gcc-help

Does GNU compiler guarantee that, upon entering an Extended Asm block, 
the stack pointer is suitably  aligned (according to the target ABI) for 
a function call? If the answer is no, is there a way to trigger this 
kind of alignment?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [QUESTION] Stack alignment in Extended Asm Blocks
  2021-09-04  1:47 [QUESTION] Stack alignment in Extended Asm Blocks Commeownist
@ 2021-09-04 13:33 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2021-09-04 13:33 UTC (permalink / raw)
  To: Commeownist; +Cc: gcc-help

On Sat, Sep 04, 2021 at 04:47:04AM +0300, Commeownist wrote:
> Does GNU compiler guarantee that, upon entering an Extended Asm block, 
> the stack pointer is suitably  aligned (according to the target ABI) for 
> a function call? If the answer is no, is there a way to trigger this 
> kind of alignment?

There is no such guarantee, and there is no special way to get such
alignment.  You will just have to write assembler code to do this.

This should only come up if calling very external functions (if not,
just write C to do such calls!)  If you need non-trivial code to call
the external function, you are probably best off writing a trampoline
function for it (in actual assembler code, a .s file) that you can call
as a normal function.


Segher

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-04 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04  1:47 [QUESTION] Stack alignment in Extended Asm Blocks Commeownist
2021-09-04 13:33 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).