[Bug target/77587] C compiler produces incorrect stack alignment with __attribute__((weak))

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 14 12:22:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77587

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-09-14
                 CC|                            |trippels at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 tmp % gcc -c stacktest.c -S -o -
        .file   "stacktest.c"
        .text
        .globl  APP_PointChangeHandlerDefault
        .type   APP_PointChangeHandlerDefault, @function
APP_PointChangeHandlerDefault:
.LFB2:
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register 6
        movq    %rdi, -8(%rbp)
        movq    %rsi, -16(%rbp)
        movq    %rdx, -24(%rbp)
        nop
        popq    %rbp
        .cfi_def_cfa 7, 8
        ret
        .cfi_endproc
.LFE2:
        .size   APP_PointChangeHandlerDefault, .-APP_PointChangeHandlerDefault
        .weak   APP_PointChangeHandler
        .set    APP_PointChangeHandler,APP_PointChangeHandlerDefault
        .globl  test_onPointChange
        .type   test_onPointChange, @function
test_onPointChange:
.LFB3:
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register 6
        subq    $24, %rsp
                ^^^ ----> this should be $32
        movq    %rdi, -8(%rbp)
        movq    %rsi, -16(%rbp)
        movq    %rdx, -24(%rbp)
        movl    $0, %edx
        movl    $0, %esi
        movl    $0, %edi
        call    APP_PointChangeHandler
        nop
        leave
        .cfi_def_cfa 7, 8
        ret
        .cfi_endproc


More information about the Gcc-bugs mailing list