Why gcc disassembler allocating extra space for local variable?

前端 未结 3 489
萌比男神i
萌比男神i 2020-12-11 16:49

I have written simple function in C,

void GetInput()
{
    char buffer[8];
    gets(buffer);
    puts(buffer);
}

When I disassemble it in g

3条回答
  •  旧巷少年郎
    2020-12-11 17:29

    Besides the other answers already given, gcc will prefer to keep the stack 16-byte aligned for storing SSE values on the stack since some (all?) of the SSE instructions require their memory argument to be 16-byte aligned.

提交回复
热议问题