I came across this code in i386_thiscall_push_dummy_call:
...
int args_space = 0;
...
for (write_pass = 0; write_pass < 2; write_pass++)
{
int args_space_used = 0;
...
if (write_pass)
{
store_unsigned_integer (buf, 4, byte_order, struct_addr);
write_memory (sp, buf, 4);
args_space_used += 4;
}
else
args_space += 4;
...
and wondered about the difference between arg_space and arg_space_used.
AFAICT, there is none:
- args_space is available after the loop, but unused after the loop
- in the loop body:
- if write_pass == 0: args_space is used
- if write_pass == 1: arg_space_used
- the code modifying args_space and args_space_used is identical
Simplify the loop body by using just one variable: args_space.
Tested on x86_64-linux with target board unix/-m32.