From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14462 invoked by alias); 17 Feb 2014 15:26:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14449 invoked by uid 89); 17 Feb 2014 15:26:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 17 Feb 2014 15:26:25 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C66E4AC86; Mon, 17 Feb 2014 15:26:22 +0000 (UTC) Date: Mon, 17 Feb 2014 15:26:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org cc: Jakub Jelinek Subject: [PATCH] Properly release pattern stmts Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2014-02/txt/msg01008.txt.bz2 This makes sure pattern stmts do not appear to be in the IL, first by setting their BB to NULL again (the vectorizer sets this for convenience I guess) and second by releasing SSA names we temporarily allocated. Esp. the non-NULL BB may confuse passes walking over non-released SSA names. Bootstrapped and tested on x86_64-unknown-linux-gnu, ok? Thanks, Richard. 2014-02-17 Richard Biener * tree-vect-stmts.c (free_stmt_vec_info): Clear BB and release SSA defs of pattern stmts. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 207757) +++ gcc/tree-vect-stmts.c (working copy) @@ -7389,13 +7389,25 @@ free_stmt_vec_info (gimple stmt) if (patt_info) { gimple_seq seq = STMT_VINFO_PATTERN_DEF_SEQ (patt_info); + gimple patt_stmt = STMT_VINFO_STMT (patt_info); + gimple_set_bb (patt_stmt, NULL); + tree lhs = gimple_get_lhs (patt_stmt); + if (TREE_CODE (lhs) == SSA_NAME) + release_ssa_name (lhs); if (seq) { gimple_stmt_iterator si; for (si = gsi_start (seq); !gsi_end_p (si); gsi_next (&si)) - free_stmt_vec_info (gsi_stmt (si)); + { + gimple seq_stmt = gsi_stmt (si); + gimple_set_bb (seq_stmt, NULL); + lhs = gimple_get_lhs (patt_stmt); + if (TREE_CODE (lhs) == SSA_NAME) + release_ssa_name (lhs); + free_stmt_vec_info (seq_stmt); + } } - free_stmt_vec_info (STMT_VINFO_RELATED_STMT (stmt_info)); + free_stmt_vec_info (patt_stmt); } }