From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7285 invoked by alias); 15 Feb 2012 11:47:56 -0000 Received: (qmail 7273 invoked by uid 22791); 15 Feb 2012 11:47:55 -0000 X-SWARE-Spam-Status: No, hits=-2.9 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; Wed, 15 Feb 2012 11:47:43 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/52255] [4.7 Regression] ICE: verify_ssa failed, block does not dominate use Date: Wed, 15 Feb 2012 11:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 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 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-02/txt/msg01535.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52255 --- Comment #3 from Jakub Jelinek 2012-02-15 11:47:15 UTC --- The problem is that lsm doesn't cleanup unnecessary VOP PHI after changing: : # b.2_21 = PHI # .MEM_22 = PHI <.MEM_18(10), .MEM_16(8)> # prephitmp.8_6 = PHI D.1720_7 = prephitmp.8_6; D.1721_8 = D.1720_7 | 1; # .MEM_17 = VDEF <.MEM_22> c[0] = D.1721_8; b.3_10 = b.2_21 + 1; # .MEM_18 = VDEF <.MEM_17> b = b.3_10; if (b.3_10 != 0) goto ; else goto ; : goto ; into: # VUSE <.MEM_17> pretmp.7_1 = c[0]; # VUSE <.MEM_17> c_I_lsm.9_12 = c[0]; # VUSE <.MEM_17> b_lsm.10_11 = b; : # b.2_21 = PHI # .MEM_22 = PHI <.MEM_22(10), .MEM_17(8)> # prephitmp.8_6 = PHI D.1720_7 = prephitmp.8_6; D.1721_8 = D.1720_7 | 1; c_I_lsm.9_24 = D.1721_8; b.3_10 = b.2_21 + 1; b_lsm.10_28 = b.3_10; if (b.3_10 != 0) goto ; else goto ; : # c_I_lsm.9_32 = PHI # b_lsm.10_33 = PHI # .MEM_29 = VDEF <.MEM_22> c[0] = c_I_lsm.9_32; # .MEM_30 = VDEF <.MEM_29> b = b_lsm.10_33; goto ; : goto ; and there is no dom/phicprop pass in between lim1 and vect that would clean this mess up (with -O3 -fno-tree-vectorize first dom2 changes that # .MEM_22 = PHI <.MEM_22(10), .MEM_17(8)> into # .MEM_22 = PHI <.MEM_17(10), .MEM_17(8)> and then phicprop removes it, but e.g. with -O3 -fno-tree-vectorize -fno-tree-dominator-opts it survives until *.optimized dump). The vectorizer then ignores virtual PHIs, assuming everything will be handled well by the data ref analysis and adjustments to the stores in the loop. Which works if the loop has any stores, because then the stores will have their vdefs renamed, but if the loop doesn't have any stores, we end up with the verification ICE here. I think the vectorizer can't rely on these unnecessary virtual PHIs not being present, so either it could give up on them, or at least for the simple cases (like this when the virtual PHI on loop->header bb uses itself and some .MEM from before the loop) could be handled by just propagating the .MEM from before the loop into all the uses of this vdef.