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

--- Comment #4 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
`gcc` produces the following assembly:

$ gcc/xgcc -Bgcc  -fbuilding-libgcc -fno-stack-protector   -S __main.c.c -o -
-O2

        .file   "__main.c.c"
        .text
        .p2align 4
        .globl  ___do_global_dtors
        .def    ___do_global_dtors;     .scl    2;      .type   32;     .endef
___do_global_dtors:
        movl    ___CTOR_LIST__, %eax
        testl   %eax, %eax
        je      L1
L3:
        jmp     L3
        .p2align 4,,10
        .p2align 3
L1:
        ret
        .ident  "GCC: (GNU) 15.0.0 99999999 (experimental)"
        .section        .rdata$refptr.__CTOR_LIST__, "dr"
        .globl  refptr.__CTOR_LIST__
        .linkonce       discard
refptr.__CTOR_LIST__:
        .quad   __CTOR_LIST__

`.quad   __CTOR_LIST__` looks wrong for a 32-bit target.

For comparison `gcc-13` produces slightly different result:

$ i686-w64-mingw32-gcc-13.3.0 -fbuilding-libgcc -fno-stack-protector   -S
__main.c.c -o - -O2
        .file   "__main.c.c"
        .text
        .p2align 4
        .globl  ___do_global_dtors
        .def    ___do_global_dtors;     .scl    2;      .type   32;     .endef
___do_global_dtors:
        movl    ___CTOR_LIST__, %eax
        testl   %eax, %eax
        je      L1
L3:
        jmp     L3
        .p2align 4,,10
        .p2align 3
L1:
        ret
        .ident  "GCC: (GNU) 13.3.0"

Reply via email to