From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49759 invoked by alias); 1 Sep 2015 22:26:31 -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 49748 invoked by uid 89); 1 Sep 2015 22:26:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 01 Sep 2015 22:26:29 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 9168BCE0; Tue, 1 Sep 2015 22:26:28 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-93.phx2.redhat.com [10.3.113.93]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t81MQS8t005320; Tue, 1 Sep 2015 18:26:28 -0400 Subject: Re: [PATCH] PR 60586 To: "Iyer, Balaji V" , "gcc-patches@gcc.gnu.org" References: Cc: "Zamyatin, Igor" From: Jeff Law Message-ID: <55E62613.7060706@redhat.com> Date: Tue, 01 Sep 2015 22:26:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00102.txt.bz2 On 08/31/2015 06:04 PM, Iyer, Balaji V wrote: > Hello Everyone, > This patch will fix the bug reported in Bugzilla, PR 60586. The issue was that the spawned function's function arguments must not be pushed into the nested/lambda function. This patch should fix that issue. > > I have tested this on x86_64 (linux and Cygwin flavors). Is this OK for trunk? > > Here are the Changelog entries: > > gcc/c-family/ChangeLog > 2015-08-31 Balaji V. Iyer > > PR middle-end/60586 > * c-common.h: Added two more parameters to the gimplify_cilk_spawn > function. > * c-gimplify.c (c_gimplify_expr): Likewise. > * cilk.c (gimplify_cilk_spawn): Likewise and called > gimplify_call_params_in_spawned_fn. > (gimplify_call_params_in_spawned_fn): New function. > > gcc/cp/ChangeLog > 2015-08-31 Balaji V. Iyer > > PR middle-end/60586 > * cp-gimplify.c (cp_gimplify_expr): Added two additional parameters to > gimplify_cilk_spawn. > > gcc/testsuite/ChangeLog > 2015-08-31 Balaji V. Iyer > > PR middle-end/60586 > * c-c++-common/cilk-plus/CK/pr60586.c: New file. > * g++.dg/cilk-plus/CK/pr60586.cc: Likewise. > > > Thanks, > > Balaji V. Iyer. > > > diff.txt > > > diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c > index 1012a4f..1fe6685 100644 > --- a/gcc/c-family/cilk.c > +++ b/gcc/c-family/cilk.c > @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see > #include "gimplify.h" > #include "tree-iterator.h" > #include "tree-inline.h" > +#include "cp/cp-tree.h" Presumably you needed this for AGGR_INIT_EXPR. I believe you need to refactor the code a bit -- including a C++ front-end header file into something in c-family seems wrong. While it may not break in this specific instance, but it is a modularity violation. > #include "c-family/c-common.h" > #include "toplev.h" > #include "tm.h" > @@ -762,12 +763,37 @@ create_cilk_wrapper (tree exp, tree *args_out) > return fndecl; > } > > +/* Gimplify all the parameters for the Spawned function. *EXPR_P can be a > + CALL_EXPR, INIT_EXPR, MODIFY_EXPR or TARGET_EXPR. *PRE_P and *POST_P are > + gimple sequences from the caller of gimplify_cilk_spawn. */ Comment doesn't match the code, code also checks for AGGR_INIT_EXPR. Given the dependency on AGGR_INIT_EXPR, it seems this checking somehow needs to move into the front-ends. I think once that's fixed this ought to be ready for the trunk. jeff