fix another x86_64 ABI bug

The old code assumed that if an argument doesn't fit into the available
registers, none of the subsequent arguments do, either. But that's
wrong: passing 7 doubles, then a two-double struct, then another double
should generate code that passes the 9th argument in the 8th register
and the two-double struct on the stack. We now do so.

However, this patch does not yet fix the function calling code to do the
right thing in the same case.
This commit is contained in:
Philip
2015-04-26 17:31:39 +00:00
parent 8d44851d65
commit 2d3458363e
2 changed files with 68 additions and 2 deletions

View File

@ -1568,7 +1568,6 @@ void gfunc_prolog(CType *func_type)
addr = (addr + align - 1) & -align;
param_addr = addr;
addr += size;
sse_param_index += reg_count;
}
break;
@ -1592,7 +1591,6 @@ void gfunc_prolog(CType *func_type)
addr = (addr + align - 1) & -align;
param_addr = addr;
addr += size;
reg_param_index += reg_count;
}
break;
}