From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19353 invoked by alias); 15 Feb 2011 21:06:46 -0000 Received: (qmail 19104 invoked by uid 22791); 15 Feb 2011 21:06:44 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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; Tue, 15 Feb 2011 21:06:40 +0000 From: "law at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/43653] [4.3/4.4/4.5/4.6 Regression] ICE at reload1.c:1188 with -O1 -ftree-vectorize and empty struct 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: law at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.3.6 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: Tue, 15 Feb 2011 21:07: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/msg01863.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43653 --- Comment #9 from Jeffrey A. Law 2011-02-15 21:06:23 UTC --- I think an x86 maintainer is going to need to take a look at this. The problem as I see it is we're trying to use the address of a stack slot as a vector initializer. (insn 20 17 21 2 (set (reg:V2DI 74 [ vect_cst_.2 ]) (vec_duplicate:V2DI (reg/f:DI 20 frame))) j.c:4 1788 {*vec_dupv2di} (expr_list:REG_EQUIV (vec_duplicate:V2DI (reg/f:DI 20 frame)) (nil))) There's nothing inherently wrong with that. Eventually frame gets turned into sp+offset like this: (insn 20 17 21 2 (set (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74]) (vec_duplicate:V2DI (plus:DI (reg/f:DI 7 sp) (const_int 392 [0x188])))) j.c:4 1788 {*vec_dupv2di} (expr_list:REG_EQUIV (vec_duplicate:V2DI (plus:DI (reg/f:DI 7 sp) (const_int 392 [0x188]))) (nil))) This is a natural result of FP elimination and IMHO, we're still OK. That later gets turned into: (insn 20 17 21 2 (set (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74]) (vec_duplicate:V2DI (plus:DI (reg/f:DI 7 sp) (mem/u/c/i:DI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0 S8 A64])))) j.c:4 1788 {*vec_dupv2di} (expr_list:REG_EQUIV (vec_duplicate:V2DI (plus:DI (reg/f:DI 7 sp) (const_int 392 [0x188]))) (nil))) Dubious, but I understand why the code did this. We'll have the following reload recorded: Reload 0: reload_in (DI) = (plus:DI (reg/f:DI 7 sp) (mem/u/c/i:DI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0 S8 A64])) reload_out (V2DI) = (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74]) SSE_REGS, RELOAD_OTHER (opnum = 0), can't combine reload_in_reg: (plus:DI (reg/f:DI 7 sp) (const_int 392 [0x188])) reload_out_reg: (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74]) reload_reg_rtx: (reg:V2DI 22 xmm1) Which simply isn't going to work and it's all downhill from there, including a surprise secondary memory allocation which ultimately triggers the ICE. I was able to hack things to work by enabling a secondary reload when copying (plus (sp) (whatever)) into SSE_REGS, but that may not be the best solution. Someone with more x86 internal knowledge should look at this.