This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Default function calling convention on x86_64


Hi there,

I am not sure if I'm supposed to post this in here, so forgive me in
case I'm wrong...
I am engaged in the development of a linux benchmark system (something
like Sandra under Window$). For such project I will be needing to
write some assembly code, specially for AMD64 systems...
Well, my question is: 

Why does gcc ignores user defined calling conventions when generating
64 bit code????
When compiling a function like

void some_func() __attribute__ ((cdecl));

I get the warning: warning: `cdecl' attribute ignored

If the same code is compiled using -m32, I see no warnings...

By looking at the assembly generated code, I think (I'm still a little
confused by AMD64's gas syntax) the arguments are passed on registers.
Can someone confirm this??

The fact is that I need to set the calling convention as cdecl for all
assembly linked functions so that 64 and 32 bit asm functions do not
differ when it comes to argument handling... I know the best thing
would be to use gcc's inline assembly syntax, but I'm really too lazy
to learn it :) ...

Thanks
Thiago Guzella


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]