[Bug c++/33452] New: native x86_64-pc-mingw32-g++.exe generate wrong asm that x86_64-pc-mingw32-as.exe can not process

drangon dot mail at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Sep 17 02:28:00 GMT 2007


I compile a cross compiler for target x86_64-pc-mingw32,
then use this cross compiler to compile a native compiler for
x86_64-pc-mingw32,
then use native compiler to compile cpp code, it generate following error:

------------------------------
$ /c/tools/target/bin/x86_64-pc-mingw32-g++.exe -v -Wall hello.cpp
Using built-in specs.
Target: x86_64-pc-mingw32
Configured with: ../gcc/configure --host=x86_64-pc-mingw32
--enable-languages=c,c++ --disable-nls --disable-multilib
--disable-libstdcxx-pch --enable-long-long
--with-gmp=/home/drangon/mingw/target/forgcc
--prefix=/home/drangon/mingw/target
Thread model: win32
gcc version 4.3.0 20070914 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-Wall' '-mtune=generic'
 c:/tools/target/bin/../libexec/gcc/x86_64-pc-mingw32/4.3.0/cc1plus.exe
-quiet -v -iprefix
c:\tools\target\bin\../lib/gcc/x86_64-pc-mingw32/4.3.0/ hello.cpp
-quiet -dumpbase hello.cpp -mtune=generic -auxbase hello -Wall
-version -o C:/DOCUME~1/drangon/LOCALS~1/Temp/ccQLaaaa.s
ignoring nonexistent directory
"c:\tools\target\bin\../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../include/c++/4.3.0"
ignoring nonexistent directory
"c:\tools\target\bin\../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../include/c++/4.3.0/x86_64-pc-mingw32"
ignoring nonexistent directory
"c:\tools\target\bin\../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../include/c++/4.3.0/backward"
ignoring nonexistent directory
"c:/tools/target/lib/gcc/../../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../include/c++/4.3.0"
ignoring nonexistent directory
"c:/tools/target/lib/gcc/../../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../include/c++/4.3.0/x86_64-pc-mingw32"
ignoring nonexistent directory
"c:/tools/target/lib/gcc/../../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../include/c++/4.3.0/backward"
ignoring nonexistent directory "/home/drangon/mingw/target/include"
ignoring nonexistent directory "/mingw/include64"
#include "..." search starts here:
#include <...> search starts here:
 c:\tools\target\bin\../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../include
 c:\tools\target\bin\../lib/gcc/x86_64-pc-mingw32/4.3.0/include
 c:\tools\target\bin\../lib/gcc/x86_64-pc-mingw32/4.3.0/include-fixed

c:\tools\target\bin\../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../x86_64-pc-mingw32/include
 c:/tools/target/lib/gcc/../../include
 c:/tools/target/lib/gcc/../../lib/gcc/x86_64-pc-mingw32/4.3.0/include
 c:/tools/target/lib/gcc/../../lib/gcc/x86_64-pc-mingw32/4.3.0/include-fixed

c:/tools/target/lib/gcc/../../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../x86_64-pc-mingw32/include
End of search list.
GNU C++ (GCC) version 4.3.0 20070914 (experimental) (x86_64-pc-mingw32)
       compiled by GNU C version 4.3.0 20070914 (experimental), GMP
version 4.2.2, MPFR version 2.3.0.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 952c5c349b801e679ce084d69ae4e018
hello.cpp: In function 'int main(int, char**)':
hello.cpp:9: warning: format '%d' expects type 'int', but argument 2
has type 'long long unsigned int'
hello.cpp:9: warning: format '%d' expects type 'int', but argument 3
has type 'long long unsigned int'
hello.cpp:9: warning: format '%d' expects type 'int', but argument 4
has type 'long long unsigned int'
COLLECT_GCC_OPTIONS='-v' '-Wall' '-mtune=generic'

c:/tools/target/bin/../lib/gcc/x86_64-pc-mingw32/4.3.0/../../../../x86_64-pc-mingw32/bin/as.exe
-o C:/DOCUME~1/drangon/LOCALS~1/Temp/ccwnbaaa.o
C:/DOCUME~1/drangon/LOCALS~1/Temp/ccQLaaaa.s
C:/DOCUME~1/drangon/LOCALS~1/Temp/ccQLaaaa.s: Assembler messages:
C:/DOCUME~1/drangon/LOCALS~1/Temp/ccQLaaaa.s:107: Error: unknown
pseudo-op: `.hidden'

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

the cpp file is very simple :

------------------------------------------
#include <stdio.h>

int main( int argc, char * argv[] )
{
    printf( "hello world.\n" );

    return 0;
}

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

I use the following command to generate asm code from native compiler :

/c/tools/target/bin/x86_64-pc-mingw32-g++.exe -S t2.cpp

----------------------------
        .file   "t2.cpp"
        .def    ___main;        .scl    2;      .type   32;     .endef
        .section .rdata,"dr"
LC0:
        .ascii "hello world.\0"
        .text
.globl _main
        .def    _main;  .scl    2;      .type   32;     .endef
_main:
LFB6:
        pushq   %rbp
LCFI0:
        movq    %rsp, %rbp
LCFI1:
        subq    $32, %rsp
LCFI2:
        movl    %ecx, 16(%rbp)
        movq    %rdx, 24(%rbp)
        call    ___main
        leaq    LC0(%rip), %rcx
        call    _puts
        movl    $0, %eax
        leave
        ret
LFE6:
        .section        .eh_frame,"dr"
Lframe1:
        .long   LECIE1-LSCIE1
LSCIE1:
        .long   0x0
        .byte   0x1
        .def    ___gxx_personality_v0;  .scl    2;      .type   32;     .endef
        .ascii "zPR\0"
        .uleb128 0x1
        .sleb128 -8
        .byte   0x10
        .uleb128 0x6
        .byte   0x9b
        .long   _DW.ref.__gxx_personality_v0-.
        .byte   0x1b
        .byte   0xc
        .uleb128 0x7
        .uleb128 0x8
        .byte   0x90
        .uleb128 0x1
        .align 8
LECIE1:
LSFDE1:
        .long   LEFDE1-LASFDE1
LASFDE1:
        .long   LASFDE1-Lframe1
        .long   LFB6-.
        .long   LFE6-LFB6
        .uleb128 0x0
        .byte   0x4
        .long   LCFI0-LFB6
        .byte   0xe
        .uleb128 0x10
        .byte   0x86
        .uleb128 0x2
        .byte   0x4
        .long   LCFI1-LCFI0
        .byte   0xd
        .uleb128 0x6
        .align 8
LEFDE1:
        .hidden _DW.ref.__gxx_personality_v0
.globl _DW.ref.__gxx_personality_v0
        .section        .data$DW.ref.__gxx_personality_v0,"w"
        .linkonce same_size
        .align 8
_DW.ref.__gxx_personality_v0:
        .quad   ___gxx_personality_v0
        .def    _puts;  .scl    2;      .type   32;     .endef

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

but if I use the cross compiler to generate code, the asm file does has
".hidden"

-bash-3.1$ ../cross/bin/x86_64-pc-mingw32-g++ -S t2.cpp

-------------------------------------------
        .file   "t2.cpp"
        .def    ___main;        .scl    2;      .type   32;     .endef
        .section .rdata,"dr"
LC0:
        .ascii "hello world.\0"
        .text
.globl _main
        .def    _main;  .scl    2;      .type   32;     .endef
_main:
LFB6:
        pushq   %rbp
LCFI0:
        movq    %rsp, %rbp
LCFI1:
        subq    $32, %rsp
LCFI2:
        movl    %ecx, 16(%rbp)
        movq    %rdx, 24(%rbp)
        call    ___main
        leaq    LC0(%rip), %rcx
        call    _puts
        movl    $0, %eax
        leave
        ret
LFE6:
        .section        .eh_frame,"dr"
Lframe1:
        .long   LECIE1-LSCIE1
LSCIE1:
        .long   0x0
        .byte   0x1
        .def    ___gxx_personality_v0;  .scl    2;      .type   32;     .endef
        .ascii "zPR\0"
        .uleb128 0x1
        .sleb128 -8
        .byte   0x10
        .uleb128 0x6
        .byte   0x9b
        .long   LDFCM0-.
        .byte   0x1b
        .byte   0xc
        .uleb128 0x7
        .uleb128 0x8
        .byte   0x90
        .uleb128 0x1
        .align 8
LECIE1:
LSFDE1:
        .long   LEFDE1-LASFDE1
LASFDE1:
        .long   LASFDE1-Lframe1
        .long   LFB6-.
        .long   LFE6-LFB6
        .uleb128 0x0
        .byte   0x4
        .long   LCFI0-LFB6
        .byte   0xe
        .uleb128 0x10
        .byte   0x86
        .uleb128 0x2
        .byte   0x4
        .long   LCFI1-LCFI0
        .byte   0xd
        .uleb128 0x6
        .align 8
LEFDE1:
        .data
        .align 8
LDFCM0:
        .quad   ___gxx_personality_v0
        .def    _puts;  .scl    2;      .type   32;     .endef
---------------------------------------------------

I have send this bug to binutils bugzilla, they said this is not the as.exe
bug.


-- 
           Summary: native x86_64-pc-mingw32-g++.exe generate wrong asm that
                    x86_64-pc-mingw32-as.exe can not process
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drangon dot mail at gmail dot com
 GCC build triplet: x86_64-redhat-linux-gnu
  GCC host triplet: x86_64-pc-mingw32
GCC target triplet: x86_64-pc-mingw32


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



More information about the Gcc-bugs mailing list