From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23590 invoked by alias); 1 May 2012 20:22:54 -0000 Received: (qmail 23571 invoked by uid 22791); 1 May 2012 20:22:52 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CX 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; Tue, 01 May 2012 20:22:39 +0000 From: "pthaugen at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/53180] New: Revision 186378 generates incorrect code for cpu2006 416.gamess Date: Tue, 01 May 2012 20:22: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: pthaugen at gcc dot gnu.org 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: 2012-05/txt/msg00026.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53180 Bug #: 53180 Summary: Revision 186378 generates incorrect code for cpu2006 416.gamess Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: pthaugen@gcc.gnu.org CC: bergner@gcc.gnu.org, bernds@gcc.gnu.org Host: powerpc64-linux Target: powerpc64-linux Build: powerpc64-linux Created attachment 27276 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27276 testcase 416.gamess benchmark started failing with r186378 due to segfault when running the benchmark. I've tracked down to what appears to be bad code for register spilling. Subroutine with bad code is attatched, compile with "gfortran -O3 -m64 -mcpu=power7 -funroll-loops -ffast-math". Snippets from the dump files for the insns of interest: 193r.ira r186377: (insn 6636 6631 6639 43 (set (reg:SI 2943 [ D.2378 ]) (plus:SI (reg:SI 2944 [ MEM[base: D.4806_3018, index: ivtmp.1254_3009, offset: 0B] ]) (subreg/s:SI (reg/v:DI 454 [ nx+-4 ]) 4))) hsandt.f:200 78 {*addsi3_internal1} (expr_list:REG_DEAD (reg:SI 2944 [ MEM[base: D.4806_3018, index: ivtmp.1254_3009, offset: 0B] ]) (expr_list:REG_EQUIV (mem:SI (plus:DI (reg/f:DI 4113) (reg:DI 2445 [ D.4808 ])) [3 MEM[base: D.4809_3021, index: ivtmp.1232_213, offset: 0B]+0 S4 A32]) (nil)))) ... (insn 6637 6632 6640 43 (set (mem:SI (plus:DI (reg/f:DI 4113) (reg:DI 2445 [ D.4808 ])) [3 MEM[base: D.4809_3021, index: ivtmp.1232_213, offset: 0B]+0 S4 A32]) (reg:SI 2943 [ D.2378 ])) hsandt.f:200 377 {*movsi_internal1} (expr_list:REG_DEAD (reg/f:DI 4113) (expr_list:REG_DEAD (reg:SI 2943 [ D.2378 ]) (nil)))) r186378: (insn 6636 6631 6639 43 (set (reg:SI 2943 [ D.2378 ]) (plus:SI (reg:SI 2944 [ MEM[base: D.4806_3018, index: ivtmp.1254_3009, offset: 0B] ]) (subreg/s:SI (reg/v:DI 454 [ nx+-4 ]) 4))) hsandt.f:200 78 {*addsi3_internal1} (expr_list:REG_DEAD (reg:SI 2944 [ MEM[base: D.4806_3018, index: ivtmp.1254_3009, offset: 0B] ]) (nil))) ... (insn 6637 6632 6640 43 (set (mem:SI (plus:DI (reg/f:DI 4113) (reg:DI 2445 [ D.4808 ])) [3 MEM[base: D.4809_3021, index: ivtmp.1232_213, offset: 0B]+0 S4 A32]) (reg:SI 2943 [ D.2378 ])) hsandt.f:200 377 {*movsi_internal1} (expr_list:REG_DEAD (reg/f:DI 4113) (expr_list:REG_DEAD (reg:SI 2943 [ D.2378 ]) (nil)))) Note that insn 6636 no longer contains the REG_EQUIV note in r186378. Not sure of the significance yet, but something I noticed. 194r.reload r186377: changing reg in insn 6636 changing reg in insn 6637 Register 2943 now on stack. ... (insn 6636 6631 8007 43 (set (reg:SI 18 18) (plus:SI (reg:SI 18 18 [orig:2944 MEM[base: D.4806_3018, index: ivtmp.1254_3009, offset: 0B] ] [2944]) (reg:SI 11 11 [orig:454 nx ] [454]))) hsandt.f:200 78 {*addsi3_internal1} (expr_list:REG_EQUIV (mem:SI (plus:DI (reg/f:DI 19 19 [4113]) (reg:DI 6 6 [orig:2445 D.4808 ] [2445])) [3 MEM[base: D.4809_3021, index: ivtmp.1232_213, offset: 0B]+0 S4 A32]) (nil))) (insn 8007 6636 6639 43 (set (mem/c:SI (plus:DI (reg/f:DI 19 19 [4113]) (reg:DI 6 6 [orig:2445 D.4808 ] [2445])) [3 MEM[base: D.4809_3021, index: ivtmp.1232_213, offset: 0B]+0 S4 A32]) (reg:SI 18 18)) hsandt.f:200 377 {*movsi_internal1} (nil)) r186378: changing reg in insn 6636 changing reg in insn 6637 Assigning 2943(freq=2) slot 13 of 524 2290 Register 2943 now on stack. ... (insn 6636 6631 8052 43 (set (reg:SI 18 18) (plus:SI (reg:SI 18 18 [orig:2944 MEM[base: D.4806_3018, index: ivtmp.1254_3009, offset: 0B] ] [2944]) (reg:SI 11 11 [orig:454 nx ] [454]))) hsandt.f:200 78 {*addsi3_internal1} (nil)) (insn 8052 6636 6639 43 (set (mem/c:SI (plus:DI (reg/f:DI 1 1) (const_int 17664 [0x4500])) [32 %sfp+17664 S4 A64]) (reg:SI 18 18)) hsandt.f:200 377 {*movsi_internal1} (nil)) In both cases insn 6637 is deleted, but as you can see above r186378 stores to the stack, and that value is not subsequently copied into the original target location of insn 6637. I can provide more information/details if needed, just don't know what to throw in that will be useful at the moment. Configured with: /home/pthaugen/src/gcc/temp/gcc/configure --prefix=/home/pthaugen/install/gcc/temp --target=powerpc64-linux --host=powerpc64-linux --build=powerpc64-linux --enable-secureplt --enable-threads=posix --enable-shared --enable-__cxa_atexit --with-long-double-128 --enable-decimal-float --disable-alsa --enable-checking --with-lto --with-as=/home/pthaugen/install/binutils/binutils-2.21.1/bin/as --with-ld=/home/pthaugen/install/binutils/binutils-2.21.1/bin/ld --with-gmp=/home/pthaugen/install/gcc-host-libs --with-mpfr=/home/pthaugen/install/gcc-host-libs --with-mpc=/home/pthaugen/install/gcc-host-libs --with-ppl=/home/pthaugen/install/gcc-host-libs --with-cloog=/home/pthaugen/install/gcc-host-libs --with-host-libstdcxx=-Wl,-Bstatic,-L/home/pthaugen/install/gcc-host-libs/lib,-lstdc++,-Bdynamic,-lm --enable-languages=c,fortran,c++ --disable-bootstrap