public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* When will gcc assign local variables to registers?
@ 2020-11-10 11:27 visitor x
  2020-11-10 15:24 ` Andrew Haley
  0 siblings, 1 reply; 4+ messages in thread
From: visitor x @ 2020-11-10 11:27 UTC (permalink / raw)
  To: gcc-help

Hello,

I'm trying to distinguish local variable assigned to register from a binary.

I got that compilers will assign some local variable to registers rather than stack for performance reason, while which variable depends on the compiler. I also found there is a calling convention on x64 that the first six arguments are passed to register (when the class is INTEGER).

However, I got almost nothing about the rest of the case. I am aware that compilers are free to arrange variables in both stack and registers, but what pricinple or specification will they follow?

Is there any materials about gcc's behavior on deciding which variables should be kept in registers? Or any other hint to find variables stored in register from a bianry?

visitor20

^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <SL2PR02MB3596DBDC06124B066570F3D383E80@SL2PR02MB3596.apcprd02.prod.outlook.com>]

end of thread, other threads:[~2020-11-12 11:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10 11:27 When will gcc assign local variables to registers? visitor x
2020-11-10 15:24 ` Andrew Haley
     [not found] <SL2PR02MB3596DBDC06124B066570F3D383E80@SL2PR02MB3596.apcprd02.prod.outlook.com>
2020-11-12  5:04 ` visitor x
2020-11-12  6:54   ` Henri Cloetens
2020-11-12 11:43     ` x visitor

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).