From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84005 invoked by alias); 23 Nov 2015 09:40:49 -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 83989 invoked by uid 89); 23 Nov 2015 09:40:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 23 Nov 2015 09:40:47 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48375) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1a0nc5-00076V-9u for gcc-patches@gnu.org; Mon, 23 Nov 2015 04:40:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0nc3-00025N-GK for gcc-patches@gnu.org; Mon, 23 Nov 2015 04:40:44 -0500 Received: from mail-yk0-x22b.google.com ([2607:f8b0:4002:c07::22b]:34411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0nc3-00025J-9Q for gcc-patches@gnu.org; Mon, 23 Nov 2015 04:40:43 -0500 Received: by ykfs79 with SMTP id s79so232176388ykf.1 for ; Mon, 23 Nov 2015 01:40:42 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.133.69 with SMTP id v66mr23430827ywf.68.1448271642544; Mon, 23 Nov 2015 01:40:42 -0800 (PST) Received: by 10.37.93.11 with HTTP; Mon, 23 Nov 2015 01:40:42 -0800 (PST) In-Reply-To: <564F42CC.8090609@mentor.com> References: <56182D1D.2060106@mentor.com> <564F42CC.8090609@mentor.com> Date: Mon, 23 Nov 2015 09:43:00 -0000 Message-ID: Subject: Re: [PATCH, PR68460] Always call free_stmt_vec_info_vec in gather_scalar_reductions From: Richard Biener To: Tom de Vries Cc: "gcc-patches@gnu.org" Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::22b X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02661.txt.bz2 On Fri, Nov 20, 2015 at 4:57 PM, Tom de Vries wrote: > [ was: Re: [PATCH] Fix parloops gimple_uid usage ] > > On 09/10/15 23:09, Tom de Vries wrote: >> >> @@ -2392,6 +2397,9 @@ gather_scalar_reductions (loop_p loop, >> reduction_info_table_type *reduction_list >> loop_vec_info simple_inner_loop_info = NULL; >> bool allow_double_reduc = true; >> >> + if (!stmt_vec_info_vec.exists ()) >> + init_stmt_vec_info_vec (); >> + >> simple_loop_info = vect_analyze_loop_form (loop); >> if (simple_loop_info == NULL) >> return; >> @@ -2453,9 +2461,16 @@ gather_scalar_reductions (loop_p loop, >> reduction_info_table_type *reduction_list >> destroy_loop_vec_info (simple_loop_info, true); >> destroy_loop_vec_info (simple_inner_loop_info, true); >> >> + /* Release the claim on gimple_uid. */ >> + free_stmt_vec_info_vec (); >> + > > > With the src/libgomp/testsuite/libgomp.c/pr46886.c testcase, compiled in > addition with -ftree-vectorize, I ran into an ICE: > ... > src/libgomp/testsuite/libgomp.c/pr46886.c:8:5: internal compiler error: in > init_stmt_vec_info_vec, at tree-vect-stmts.c:8250 > int foo (void) > ^~~ > > 0x1196082 init_stmt_vec_info_vec() > src/gcc/tree-vect-stmts.c:8250 > 0x11c3ed4 vectorize_loops() > src/gcc/tree-vectorizer.c:510 > 0x10a7ea5 execute > src/gcc/tree-ssa-loop.c:276 > ... > > The ICE is caused by the fact that init_stmt_vec_info_vec is called at the > start of vectorize_loops, while stmt_vec_info_vec is not empty. I traced > this back to gather_scalar_reduction, where we call init_stmt_vec_info_vec, > but we skip free_stmt_vec_info_vec if we take the early-out for > simple_loop_info == NULL. > > This patch fixes the ICE by making sure we always call > free_stmt_vec_info_vec in gather_scalar_reduction. > > Passes cc1/f951 rebuild and autopar testing. > > OK for stage3 trunk if bootstrap and regtest succeeds? Ok. Richard. > Thanks, > - Tom