As far as I know, there are two possible calling conventions for the x64
code - Microsoft x64
and AMD64
.
Now, gcc
can be launched with the -mregparm=0
parameter, which doesn't work if we are working using the AMD64
calling convention. This happens because the AMD64
convention mandates the usage of the registers for the first 6 variables (I'm not really sure why this is done, but I suspect it's implemented due do possibly stack security issues).
So, here is the question:
Are there some strict rules like this (forced register usage) when compiling using gcc
under Microsoft x64
convention? And, if yes, how can they be bypassed without breaking the ABI
compatibility?