This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/68507] attribute ms_abi (on Linux) bloats by pushing/popping xmm6-15 needlessly
- From: "daniel.santos at pobox dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Nov 2015 02:38:38 +0000
- Subject: [Bug target/68507] attribute ms_abi (on Linux) bloats by pushing/popping xmm6-15 needlessly
- Auto-submitted: auto-generated
- References: <bug-68507-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68507
--- Comment #4 from Daniel Santos <daniel.santos at pobox dot com> ---
According to  3.2.1 "Registers and the Stack Frame" of the System V
Application Binary Interface for AMD64
Registers %rbp, %rbx and %r12 through %r15 âbelongâ to the calling function and
the called function is required to preserve their values. In other words, a
called function must preserve these registersâ values for its caller. Remaining
registers âbelongâ to the called function.5 If a calling function wants to
preserve such a register value across a function call, it must save the value
in its local stack frame.
And for microsoft's "x64" calling convention
(https://msdn.microsoft.com/en-us/library/9z1stfyw.aspx), the xmm registers are
considered non-volatile, so it would appear that this is the correct behaviour,
barring some extensive whole-program analysis that can guarantee that the xmm
registers are not destroyed.