[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250222091136.GA12873@1wt.eu>
Date: Sat, 22 Feb 2025 10:11:36 +0100
From: Willy Tarreau <w@....eu>
To: David Laight <david.laight.linux@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Jan Engelhardt <ej@...i.de>, "H. Peter Anvin" <hpa@...or.com>,
Greg KH <gregkh@...uxfoundation.org>,
Boqun Feng <boqun.feng@...il.com>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Christoph Hellwig <hch@...radead.org>,
rust-for-linux <rust-for-linux@...r.kernel.org>,
David Airlie <airlied@...il.com>, linux-kernel@...r.kernel.org,
ksummit@...ts.linux.dev
Subject: Re: C aggregate passing (Rust kernel policy)
On Sat, Feb 22, 2025 at 08:41:12AM +0000, David Laight wrote:
> On Sat, 22 Feb 2025 07:37:30 +0100
> Willy Tarreau <w@....eu> wrote:
>
> ...
> > Update: I found in my code a comment suggesting that it works when using
> > -freg-struct (which is in fact -freg-struct-return) which works both on
> > i386 and ARM.
>
> The problem is that you need it to be an __attribute__(()) so it can
> be per-function without breaking ABI.
Yes I agree that it would be better.
> > I just didn't remember about this and couldn't find it when
> > looking at gcc docs.
>
> I can never find anything in there either.
> And then I wish they say when it was introduced.
Same here. At least on gcc-2.95 it was already recognized and worked fine:
- without:
fct:
movl 4(%esp),%ecx
movl $5,%eax
movl $100,%edx
movl %eax,(%ecx)
movl %edx,4(%ecx)
movl %ecx,%eax
ret $4
- with:
fct:
movl $5,%eax
movl $100,%edx
ret
Willy
Powered by blists - more mailing lists