* Eax zeroed before call
@ 2022-01-31 8:42 Peter McKinna
2022-01-31 10:01 ` Andrew Haley
0 siblings, 1 reply; 2+ messages in thread
From: Peter McKinna @ 2022-01-31 8:42 UTC (permalink / raw)
To: gcc-help
Hi,
Hopefully this is the correct forum. I have a
Pascal like language using gcc as the backend.
For some reason a call to a simple procedure
with no parameters generates code to initialises eax to zero before the
call. With any parameters in the proc there’s no init.
Is there some way to prevent this init? Some
flag I can set, some arcane piece of wizardry?
Thanks Peter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Eax zeroed before call
2022-01-31 8:42 Eax zeroed before call Peter McKinna
@ 2022-01-31 10:01 ` Andrew Haley
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2022-01-31 10:01 UTC (permalink / raw)
To: gcc-help
On 1/31/22 08:42, Peter McKinna via Gcc-help wrote:
> Hopefully this is the correct forum. I have a
> Pascal like language using gcc as the backend.
> For some reason a call to a simple procedure
> with no parameters generates code to initialises eax to zero before the
> call. With any parameters in the proc there’s no init.
>
> Is there some way to prevent this init? Some
> flag I can set, some arcane piece of wizardry?
If your simple procedure doesn't have a prototype, EAX is initialized
to the number of arguments passed in vector registers, for compatibility
with old varargs functions.
I suggest you provide a prototype.
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-31 10:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 8:42 Eax zeroed before call Peter McKinna
2022-01-31 10:01 ` Andrew Haley
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).