From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17969 invoked by alias); 14 Oct 2011 05:25:51 -0000 Received: (qmail 17955 invoked by uid 22791); 14 Oct 2011 05:25:48 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,LOTS_OF_MONEY,TW_JL X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Oct 2011 05:25:32 +0000 From: "jojelino at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/50725] New: [4.7 regression] -O3 -mstackrealign -march=core2 generates invalid prologue code in callee procedure Date: Fri, 14 Oct 2011 05:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jojelino at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg01315.txt.bz2 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: unassigned@gcc.gnu.org ReportedBy: jojelino@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'