From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15655 invoked by alias); 9 Nov 2010 09:13:21 -0000 Received: (qmail 15645 invoked by uid 22791); 9 Nov 2010 09:13:20 -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; Tue, 09 Nov 2010 09:13:16 +0000 From: "irar at il dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer 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: irar at il dot ibm.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.0 X-Bugzilla-Changed-Fields: CC 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, 09 Nov 2010 09:13: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: 2010-11/txt/msg01054.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971 Ira Rosen changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |irar at il dot ibm.com --- Comment #8 from Ira Rosen 2010-11-09 09:12:43 UTC --- Looking at this loop: void foo (int *x, int *y) { int i; for (i = 0; i < 11; i++) y[i] = (x[i] == 1) ? i + 1 : -(i + 1); } I see that first time that we try to analyze phi i_19 = PHI (to detect induction), scev analysis succeeds: (analyze_scalar_evolution (loop_nb = 1) (scalar = i_19) (get_scalar_evolution (scalar = i_19) (scalar_evolution = {0, +, 1}_1)) (set_scalar_evolution instantiated_below = 2 (scalar = i_19) (scalar_evolution = {0, +, 1}_1)) ) pr45971.c:5: note: Access function of PHI: {0, +, 1}_1 pr45971.c:5: note: step: 1, init: 0 But when we try to check the same phi later (in transformation), evolution analysis fails: pr45971.c:5: note: vect_update_ivs_after_vectorizer: phi: i_19 = PHI (analyze_scalar_evolution (loop_nb = 1) (scalar = i_19) (get_scalar_evolution (scalar = i_19) (scalar_evolution = )) (analyze_initial_condition (loop_phi_node = i_19 = PHI ) (init_cond = 0)) (analyze_evolution_in_loop (loop_phi_node = i_19 = PHI ) (evolution_function = scev_not_known)) (set_scalar_evolution instantiated_below = 8 (scalar = i_19) (scalar_evolution = i_19)) ) pr45971.c:5: note: Access function of PHI: i_19 causing ICE. Here is the code that if-cvt generates: # i_19 = PHI # ivtmp.9_15 = PHI D.2688_4 = (long unsigned int) i_19; D.2689_5 = D.2688_4 * 4; D.2690_7 = y_6(D) + D.2689_5; D.2692_11 = x_10(D) + D.2689_5; D.2693_12 = *D.2692_11; iftmp.0_13 = i_19 + 1; D.2707_22 = D.2693_12 == 1; iftmp.0_14 = ~i_19; pretmp.7_24 = i_19 + 1; D.2708_21 = D.2693_12 != 1; iftmp.0_2 = [cond_expr] D.2693_12 == 1 ? iftmp.0_13 : iftmp.0_14; prephitmp.8_25 = [cond_expr] D.2693_12 == 1 ? iftmp.0_13 : pretmp.7_24; *D.2690_7 = iftmp.0_2; ivtmp.9_23 = ivtmp.9_15 - 1; if (ivtmp.9_23 != 0) goto ; else goto ; prephitmp.8_25 is actually always i_19 + 1, so the second cond_expr is redundant.