On my 32bit x86 Ubuntu11.10, gcc4.6.3 pass the arguments by stack. Is there any gcc optimization that force gcc to pass arguments by registers? And how gcc do that? I want some details, please.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The relevant attribute is
__attribute__((fastcall)). Functions declared with this attribute are called with their first eligible argument in ECX and the second in EDX.(I’m assuming x86. You just said 32 bits, but that covers many architectures such as ARM).