public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Ulrich Drepper <drepper@gmail.com>, gcc@gcc.gnu.org
Subject: Re: asm in inline function invalidating function attributes?
Date: Mon, 17 Oct 2011 11:11:00 -0000	[thread overview]
Message-ID: <CAFiYyc17q7SwKHr9ax_QctbZOFzdsUHv3JqTi+0gZauZnd=3SQ@mail.gmail.com> (raw)
In-Reply-To: <m2wrc4zey3.fsf@firstfloor.org>

On Mon, Oct 17, 2011 at 1:36 AM, Andi Kleen <andi@firstfloor.org> wrote:
> Ulrich Drepper <drepper@gmail.com> writes:
>>
>> It's not guaranteed to work in general.  The problem to solve is that
>> I know the function which is called is not clobbering any registers.
>> If I leave it with the normal function call gcc has to spill
>> registers.  If I can hide the function call the generated code can be
>> significantly better.
>
> iirc the new shrink wrapping support that just went in was to address
> problems like that. Perhaps try a mainline compiler?
>
> But I agree that such an attribute would be useful. I would use it.
>
> At least the Linux kernel has a couple such cases ("nasty inline asm to
> hide register clobbering in calls") and it's always ugly and hard to
> maintain.

It would simply be an alternate ABI that makes all registers callee-saved?
I suppose that would be not too hard to add.

Richard.

> -Andi
> --
> ak@linux.intel.com -- Speaking for myself only
>

  reply	other threads:[~2011-10-17  6:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-16  3:29 Ulrich Drepper
2011-10-16 18:52 ` Richard Guenther
2011-10-16 23:37   ` Ulrich Drepper
2011-10-17  8:53     ` Andi Kleen
2011-10-17 11:11       ` Richard Guenther [this message]
2011-10-17 16:20         ` Ulrich Drepper
2011-10-17 16:28         ` Andi Kleen
2011-10-17  4:08 ` Jakub Jelinek
2011-10-17  6:57   ` Ulrich Drepper

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='CAFiYyc17q7SwKHr9ax_QctbZOFzdsUHv3JqTi+0gZauZnd=3SQ@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=drepper@gmail.com \
    --cc=gcc@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).