From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17838 invoked by alias); 24 Feb 2011 21:54:07 -0000 Received: (qmail 17830 invoked by uid 22791); 24 Feb 2011 21:54:06 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Thu, 24 Feb 2011 21:54:03 +0000 From: "pthaugen at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/47862] Incorrect code for spilling a vector register X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 24 Feb 2011 22:00:00 -0000 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-02/txt/msg02811.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47862 --- Comment #1 from Pat Haugen 2011-02-24 21:54:00 UTC --- Looks like the bogus spill/restore insns are being inserted via caller-save.c routines since IRA assigned volatile regs to pseudos which are live across a call. 190.sched1 dump for the example above (pseudo 352). (insn 180 177 182 12 (set (reg:V2DF 352 [ vect_var_.59 ]) (mult:V2DF (reg:V2DF 343 [ vect_var_.53 ]) (reg:V2DF 350 [ vect_cst_.60 ]))) spill.c:21 766 {*vsx_mulv2df3} (nil)) ... call expd2() (insn 185 184 186 12 (set (reg:V2DF 79 2) (reg:V2DF 352 [ vect_var_.59 ])) spill.c:21 756 {*vsx_movv2df} (expr_list:REG_DEAD (reg:V2DF 352 [ vect_var_.59 ]) (nil))) 191.ira dump, along with some additional info I dumped in caller-save:insert_one_insn() to show insn being inserted Popping a139(r352,l0) -- assign reg 43 (vector save) Inserting insn ... (set (mem/c:DI (plus:DI (reg/f:DI 113 sfp) (const_int 144 [0x90])) [9 S8 A64]) (reg:DI 43 11)) (vector restore) Inserting insn ... (set (reg:DI 43 11) (mem/c:DI (plus:DI (reg/f:DI 113 sfp) (const_int 144 [0x90])) [9 S8 A64])) ... before ... (insn 185 184 186 12 (set (reg:V2DF 79 2) (reg:V2DF 43 11 [orig:352 vect_var_.59 ] [352])) spill.c:21 756 {*vsx_movv2df} (expr_list:REG_DEAD (reg:V2DF 43 11 [orig:352 vect_var_.59 ] [352]) (nil))) ---final ira dump (insn 180 177 182 12 (set (reg:V2DF 43 11 [orig:352 vect_var_.59 ] [352]) (mult:V2DF (reg:V2DF 103 26 [orig:343 vect_var_.53 ] [343]) (reg:V2DF 44 12 [orig:350 vect_cst_.60 ] [350]))) spill.c:21 766 {*vsx_mulv2df3} (nil)) (insn 323 322 324 12 (set (mem/c:DI (plus:DI (reg/f:DI 1 1) (const_int 144 [0x90])) [9 S8 A64]) (reg:DI 43 11)) spill.c:21 405 {*movdi_internal64} (nil)) ... call expd2() (insn 326 184 185 12 (set (reg:DI 43 11) (mem/c:DI (plus:DI (reg/f:DI 1 1) (const_int 144 [0x90])) [9 S8 A64])) spill.c:21 405 {*movdi_internal64} (nil)) (insn 185 326 186 12 (set (reg:V2DF 79 2) (reg:V2DF 43 11 [orig:352 vect_var_.59 ] [352])) spill.c:21 756 {*vsx_movv2df} (nil))