http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36282



Bernhard Reutner-Fischer <aldot at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

      Known to work|                            |3.4.6

            Summary|Spurious warning "asm       |[4.7/4.8/4.9 Regression]

                   |declaration ignored due to  |Spurious warning "asm

                   |conflict with previous      |declaration ignored due to

                   |rename"                     |conflict with previous

                   |                            |rename"

      Known to fail|                            |4.7.2, 4.8.0



--- Comment #5 from Bernhard Reutner-Fischer <aldot at gcc dot gnu.org> 
2013-03-22 13:06:47 UTC ---

$ gcc-3.4 -fno-exceptions -fomit-frame-pointer -fno-builtin -S pr36282.c -o

ok.s

$ gcc-4.7 -fno-exceptions -fomit-frame-pointer -fno-builtin -S pr36282.c -o

nak.s

pr36282.c:3:1: warning: asm declaration ignored due to conflict with previous

rename [-Wpragmas]



$ cat pr36282.c 

#pragma weak __pthread_initialize

extern void *memcpy(void *dest, const void *src, int n);

extern typeof(memcpy) memcpy asm("__GI_memcpy");

char *usr(void) {

    char ch[2];

    return memcpy(&ch, "x", 2);

}

$ cat ok.s

    .file    "pr36282.c"

    .section    .rodata

.LC0:

    .string    "x"

    .text

.globl usr

    .type    usr, @function

usr:

.LFB2:

    subq    $24, %rsp

.LCFI0:

    movq    %rsp, %rdi

    movl    $2, %edx

    movl    $.LC0, %esi

    call    __GI_memcpy

    addq    $24, %rsp

    ret

.LFE2:

    .size    usr, .-usr

    .section    .eh_frame,"a",@progbits

.Lframe1:

    .long    .LECIE1-.LSCIE1

.LSCIE1:

    .long    0x0

    .byte    0x1

    .string    ""

    .uleb128 0x1

    .sleb128 -8

    .byte    0x10

    .byte    0xc

    .uleb128 0x7

    .uleb128 0x8

    .byte    0x90

    .uleb128 0x1

    .align 8

.LECIE1:

.LSFDE1:

    .long    .LEFDE1-.LASFDE1

.LASFDE1:

    .long    .LASFDE1-.Lframe1

    .quad    .LFB2

    .quad    .LFE2-.LFB2

    .byte    0x4

    .long    .LCFI0-.LFB2

    .byte    0xe

    .uleb128 0x20

    .align 8

.LEFDE1:

    .section    .note.GNU-stack,"",@progbits

    .ident    "GCC: (GNU) 3.4.6 (Debian 3.4.6-10)"



$ cat nak.s

    .file    "pr36282.c"

    .section    .rodata

.LC0:

    .string    "x"

    .text

    .globl    usr

    .type    usr, @function

usr:

.LFB0:

    .cfi_startproc

    subq    $24, %rsp

    .cfi_def_cfa_offset 32

    movq    %rsp, %rax

    movl    $2, %edx

    movl    $.LC0, %esi

    movq    %rax, %rdi

    call    memcpy

    addq    $24, %rsp

    .cfi_def_cfa_offset 8

    ret

    .cfi_endproc

.LFE0:

    .size    usr, .-usr

    .ident    "GCC: (Debian 4.7.2-5) 4.7.2"

    .section    .note.GNU-stack,"",@progbits

Reply via email to