From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68764 invoked by alias); 23 Nov 2015 09:54:38 -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 68627 invoked by uid 89); 23 Nov 2015 09:54:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f181.google.com Received: from mail-yk0-f181.google.com (HELO mail-yk0-f181.google.com) (209.85.160.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 23 Nov 2015 09:54:33 +0000 Received: by ykdr82 with SMTP id r82so229954174ykd.3 for ; Mon, 23 Nov 2015 01:54:32 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.40.147 with SMTP id o141mr12605090ywo.305.1448272471950; Mon, 23 Nov 2015 01:54:31 -0800 (PST) Received: by 10.37.93.11 with HTTP; Mon, 23 Nov 2015 01:54:31 -0800 (PST) In-Reply-To: <20151120200326.GL5675@tucnak.redhat.com> References: <20151120200326.GL5675@tucnak.redhat.com> Date: Mon, 23 Nov 2015 09:57:00 -0000 Message-ID: Subject: Re: [PATCH] Fix GC ICE during simd clone creation (PR middle-end/68339) From: Richard Biener To: Jakub Jelinek Cc: GCC Patches , Jan Hubicka Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02665.txt.bz2 On Fri, Nov 20, 2015 at 9:03 PM, Jakub Jelinek wrote: > Hi! > > node->get_body () can run various IPA passes and ggc_collect in them Aww. Looks like we never implemented that ggc_defer_collecting idea (don't remember the context this popped up, maybe it was when we introduced TODO_do_not_ggc_collect). At least late IPA passes might be affected by this issue as well. Richard. >, so > it is undesirable to hold pointers to GC memory in automatic vars over it. > While I could store those vars (clone_info, clone and id) into special GTY > vars just to avoid collecting them, it seems easier to call node->get_body > () earlier. > > Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk > and 5 branch. > > 2015-11-20 Jakub Jelinek > > PR middle-end/68339 > * omp-low.c (expand_simd_clones): Call node->get_body () before > allocating stuff in GC. > > * gcc.dg/vect/pr68339.c: New test. > > --- gcc/omp-low.c.jj 2015-11-18 11:19:19.000000000 +0100 > +++ gcc/omp-low.c 2015-11-20 12:56:17.075193601 +0100 > @@ -18319,6 +18319,10 @@ expand_simd_clones (struct cgraph_node * > && TYPE_ARG_TYPES (TREE_TYPE (node->decl)) == NULL_TREE) > return; > > + /* Call this before creating clone_info, as it might ggc_collect. */ > + if (node->definition && node->has_gimple_body_p ()) > + node->get_body (); > + > do > { > /* Start with parsing the "omp declare simd" attribute(s). */ > --- gcc/testsuite/gcc.dg/vect/pr68339.c.jj 2015-11-20 13:10:47.756905395 +0100 > +++ gcc/testsuite/gcc.dg/vect/pr68339.c 2015-11-20 13:08:13.000000000 +0100 > @@ -0,0 +1,17 @@ > +/* PR middle-end/68339 */ > +/* { dg-do compile } */ > +/* { dg-options "--param ggc-min-heapsize=0 --param ggc-min-expand=0 -fopenmp-simd" } */ > + > +#pragma omp declare simd notinbranch > +int > +f1 (int x) > +{ > + return x; > +} > + > +#pragma omp declare simd notinbranch > +int > +f2 (int x) > +{ > + return x; > +} > > Jakub