From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12538 invoked by alias); 21 Aug 2011 07:55:25 -0000 Received: (qmail 12470 invoked by uid 22791); 21 Aug 2011 07:55:24 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_TM 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; Sun, 21 Aug 2011 07:55:09 +0000 From: "irar at il dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/50133] [4.7 Regression] ICE: SIGSEGV in vect_finish_stmt_generation (gimple.h:4821) with -ftree-vectorize -fno-tree-loop-im Date: Sun, 21 Aug 2011 07:56: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: irar at il dot ibm.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.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 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-08/txt/msg01746.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50133 Ira Rosen changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |irar at il dot ibm.com --- Comment #1 from Ira Rosen 2011-08-21 06:02:10 UTC --- When creating a vector from an invariant scalar load, we do gsi_next (&gsi2); in order to insert the vector after the load. In this testcase the load is the last stmt in its basic block, which causes the failure when we try to call gsi_stmt(). This patch fixes the failure: Index: tree-vect-stmts.c =================================================================== --- tree-vect-stmts.c (revision 177929) +++ tree-vect-stmts.c (working copy) @@ -1435,6 +1435,9 @@ vect_finish_stmt_generation (gimple stmt, gimple v } si = *gsi; + if (gsi_end_p (si)) + si = gsi_for_stmt (stmt); + if (is_gimple_debug (gsi_stmt (si))) { gsi_next_nondebug (&si); but it's a hack. We could add a new parameter insert_after to vect_finish_stmt_generation (), to indicate that VECT_STMT should be inserted after GSI and not before. For this case we would have to pass it to vect_init_vector() first. Ira