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

             Bug #: 50725
           Summary: [4.7 regression] -O3 -mstackrealign -march=core2
                    generates invalid prologue code in callee procedure
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jojel...@gmail.com


Created attachment 25493
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25493
preprocessed source

it does generates wrong prologue. here are some pieces of it.
    .ascii "  Unknown pseudo relocation bit size %d.\12\0"
    .text
    .p2align 4,,15
    .globl    __Z25_pei386_runtime_relocatorP11per_process
    .def    __Z25_pei386_runtime_relocatorP11per_process;    .scl    2;   
.type    32;    .endef
__Z25_pei386_runtime_relocatorP11per_process:
LFB221:
    .cfi_startproc
    movl    (%ecx), %eax
    imull    $1000, 128(%eax), %edx
    addl    132(%eax), %edx
    cmpl    $226, %edx
    ja    L95
    ret 
    .p2align 4,,10
L95:

it is trivial that %ecx is not where first parameter stored. so please fix this
problem.

$ g++ -c -O3 -mstackrealign -march=core2 -o ./pseudo-reloc.o ./pseudo-reloc.ii
-v -save-temps
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-cygwin/4.7.0/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: ./configure --config-cache --prefix=/usr
--disable-win32-registry --enable-threads=win32
--enable-languages=c,c++,fortran,lto --with-win32-nlsapi=unicode --enable-tls
--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp
--enable-cloog-backend=isl : (reconfigured)  : (reconfigured) ./configure
--config-cache --prefix=/usr --disable-win32-registry --enable-threads=win32
--with-win32-nlsapi=unicode --enable-tls --disable-bootstrap --enable-shared
--disable-sjlj-exceptions --enable-gomp --enable-cloog-backend=isl
--enable-languages=c,c++,fortran,lto --no-create --no-recursion
Thread model: win32
gcc version 4.7.0 20111011 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-c' '-O3' '-mstackrealign' '-march=core2' '-o'
'./pseudo-reloc.o' '-v' '-save-temps' '-shared-libgcc'
 /usr/libexec/gcc/i686-pc-cygwin/4.7.0/cc1plus.exe -fpreprocessed
./pseudo-reloc.ii -quiet -dumpbase pseudo-reloc.ii -mstackrealign -march=core2
-auxbase-strip ./pseudo-reloc.o -O3 -version -o pseudo-reloc.s
GNU C++ (GCC) version 4.7.0 20111011 (experimental) (i686-pc-cygwin)
        compiled by GNU C version 4.7.0 20111006 (experimental), GMP version
5.0.0, MPFR version 3.0.1-p4, MPC version 0.8.1
warning: MPFR header version 3.0.1-p4 differs from library version 3.2.0-dev.
warning: MPC header version 0.8.1 differs from library version 0.9.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.7.0 20111011 (experimental) (i686-pc-cygwin)
        compiled by GNU C version 4.7.0 20111006 (experimental), GMP version
5.0.0, MPFR version 3.0.1-p4, MPC version 0.8.1
warning: MPFR header version 3.0.1-p4 differs from library version 3.2.0-dev.
warning: MPC header version 0.8.1 differs from library version 0.9.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: fd6a3acd2dd7d494d520503529e6a109
COLLECT_GCC_OPTIONS='-c' '-O3' '-mstackrealign' '-march=core2' '-o'
'./pseudo-reloc.o' '-v' '-save-temps' '-shared-libgcc'
 /usr/lib/gcc/i686-pc-cygwin/4.7.0/../../../../i686-pc-cygwin/bin/as.exe -o
./pseudo-reloc.o pseudo-reloc.s
COMPILER_PATH=/usr/libexec/gcc/i686-pc-cygwin/4.7.0/:/usr/libexec/gcc/i686-pc-cygwin/4.7.0/:/usr/libexec/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.7.0/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.7.0/../../../../i686-pc-cygwin/bin/
LIBRARY_PATH=/usr/lib/gcc/i686-pc-cygwin/4.7.0/:/usr/lib/gcc/i686-pc-cygwin/4.7.0/../../../../i686-pc-cygwin/lib/:/usr/lib/gcc/i686-pc-cygwin/4.7.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-c' '-O3' '-mstackrealign' '-march=core2' '-o'
'./pseudo-reloc.o' '-v' '-save-temps' '-shared-libgcc'

Reply via email to