Reserve space in stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When I compile this

void dummy(void);

int test (void)
{
  dummy();
  return 0;
}

$ gcc -fno-unwind-tables -fno-asynchronous-unwind-tables -march=x86-64 -mtune=generic -O2 -S test.c -o test.s


I getting this assembly output

        .file   "test.c"
        .text
        .p2align 4,,15
        .globl  test
        .type   test, @function
test:
        subq    $8, %rsp # why?
        call    dummy
        xorl    %eax, %eax
        addq    $8, %rsp # why?
        ret
        .size   test, .-test

Why need to do this subq addq? How can I disable this? I want to get:

        call    dummy
        xorl    %eax, %eax
        ret



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux