From patchwork Thu Apr 10 13:55:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zamyatin, Igor" X-Patchwork-Id: 338131 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6BCA51400E3 for ; Thu, 10 Apr 2014 23:56:20 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=JiE cyWJ1NheMtUjyDDcBclTxLYHCJjP118sW0iUqBYOD9pl6Vw9UwVfvrlYDcDSlXPl i79rOnEhtYhBs2YgJhm9nJb7FUbUfAXnc4BZ1xnTGD+9oEnzOiVCKFD2ADEPoQcV LV7aCj1NVdXzhlqHRvUxklVXaWDkNrqSxvDUE9MQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=default; bh=eFaBQpiTx ZzdG1WR1LGeETzyb8M=; b=f5tWauR67IDVm6dbZwpnP8YinOwbqU53khIAhGZDB D0WUosgnRnHVf3TL4NiC1hleaD02fumP4bx6U61Yx7Ey3ORWNbb94YC6kFzLZVHc XHToX6Rf4Ky4+dYI+wkPJhetWI5TqVCkDo7NEWGG4uYirz6HphOZZl9kCmOb57ff kM= Received: (qmail 20489 invoked by alias); 10 Apr 2014 13:56:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20478 invoked by uid 89); 10 Apr 2014 13:56:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mga02.intel.com Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Apr 2014 13:56:07 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 10 Apr 2014 06:55:47 -0700 X-ExtLoop1: 1 Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga002.jf.intel.com with ESMTP; 10 Apr 2014 06:55:44 -0700 Received: from irsmsx101.ger.corp.intel.com (163.33.3.153) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 10 Apr 2014 14:55:09 +0100 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.172]) by IRSMSX101.ger.corp.intel.com ([169.254.1.171]) with mapi id 14.03.0123.003; Thu, 10 Apr 2014 14:55:09 +0100 From: "Zamyatin, Igor" To: "GCC Patches (gcc-patches@gcc.gnu.org)" CC: "Iyer, Balaji V" , "Jakub Jelinek (jakub@redhat.com)" Subject: [PATCH, PR60467, Cilk+] Fix for ICE with incorrect Cilk_spawn usage Date: Thu, 10 Apr 2014 13:55:09 +0000 Message-ID: <0EFAB2BDD0F67E4FB6CCC8B9F87D7569429DBFD8@IRSMSX103.ger.corp.intel.com> MIME-Version: 1.0 X-IsSubscribed: yes Hi! This patch filters out another incorrect usage of Cilk_spawn keyword. Bootstrapped/regtested on x86_64. Ok for trunk? Thanks, Igor gcc/ChangeLog: 2014-04-10 Igor Zamyatin PR middle-end/60467 * c-family/cilk.c (cilk_set_spawn_marker): Remove FUNCTION_DECL as possible argument for Cilk_spawn. gcc/testsuite/ChangeLog: 2014-04-10 Igor Zamyatin PR middle-end/60467 * c-c++-common/cilk-plus/CK/invalid_spawns.c: Add new invalid case to check. diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c index 6a7bf4f..bf549ad 100644 --- a/gcc/c-family/cilk.c +++ b/gcc/c-family/cilk.c @@ -99,7 +99,6 @@ cilk_set_spawn_marker (location_t loc, tree fcall) it. */ return false; else if (TREE_CODE (fcall) != CALL_EXPR - && TREE_CODE (fcall) != FUNCTION_DECL /* In C++, TARGET_EXPR is generated when we have an overloaded '=' operator. */ && TREE_CODE (fcall) != TARGET_EXPR) diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c index ba9e619..5b43be7 100644 --- a/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c +++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c @@ -8,6 +8,7 @@ int main (void) { int x; + _Cilk_spawn foo; /* { dg-error "only function calls can be spawned" } */ _Cilk_spawn x; /* { dg-error "only function calls can be spawned" } */ return x; }