public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Commeownist <commeownist@yandex.ru>
Cc: gcc-help@gcc.gnu.org
Subject: Re: [QUESTION] Stack alignment in Extended Asm Blocks
Date: Sat, 4 Sep 2021 08:33:36 -0500	[thread overview]
Message-ID: <20210904133336.GQ1583@gate.crashing.org> (raw)
In-Reply-To: <f9643845-81c3-5777-2c2b-93fe0b93c1fb@yandex.ru>

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

      reply	other threads:[~2021-09-04 13:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04  1:47 Commeownist
2021-09-04 13:33 ` Segher Boessenkool [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210904133336.GQ1583@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=commeownist@yandex.ru \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).