From patchwork Tue Aug 7 20:21:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iyer, Balaji V" X-Patchwork-Id: 175796 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]) by ozlabs.org (Postfix) with SMTP id 537F42C008A for ; Wed, 8 Aug 2012 06:21:31 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1344975692; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:Content-Type: MIME-Version:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=AKPmlIK da4FXcwfIS5GFGUjJMAo=; b=nQD0yafp1uMfMH7g6WPjQbmFNUzgEmOLBsFlCHv 6BzSVJ87k7sQ3mJzVJO1n+WPAoao0gJe34hkYCL7dDxwTFHxoYp9uUkZwvBCFyzc qkxfFALoP85fxEJQcIO37Kj9rNQkC2flCOqjwCHGliKlvN7SSh1d8G+iBsc0dWUh BFDA= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-ExtLoop1:Received:Received:From:To:Subject:Date:Message-ID:Content-Type:MIME-Version:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=co8HAgLyjCDTB2VzwNW+gGXKSVNBK1JKHykCPYJ7x2s9fEdnihgLz672bYhDDy Dpo8Hj5rW2jJ8YVvHbcwE+t+TJJsN04+7pgNGAOq74SGFkOCLfA2k0hF9zW/QuI/ J0kL6rt4/5yF+iZcRWePMukzFo5p5+SyD9d7QDpGBEzyU=; Received: (qmail 2828 invoked by alias); 7 Aug 2012 20:21:29 -0000 Received: (qmail 2820 invoked by uid 22791); 7 Aug 2012 20:21:28 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Aug 2012 20:21:15 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 07 Aug 2012 13:21:15 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35]) by azsmga001.ch.intel.com with ESMTP; 07 Aug 2012 13:21:15 -0700 Received: from fmsmsx102.amr.corp.intel.com ([169.254.2.100]) by FMSMSX104.amr.corp.intel.com ([169.254.4.154]) with mapi id 14.01.0355.002; Tue, 7 Aug 2012 13:21:14 -0700 From: "Iyer, Balaji V" To: "gcc-patches@gcc.gnu.org" Subject: RE: [PATCH][Cilkplus] Remove unwanted static chain. Date: Tue, 7 Aug 2012 20:21:13 +0000 Message-ID: MIME-Version: 1.0 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 Sorry, I was in the wrong directory when I was creating the patch. Here is the fixed patch. Thanks, Balaji V. Iyer. -----Original Message----- From: Iyer, Balaji V Sent: Tuesday, August 07, 2012 4:18 PM To: 'gcc-patches@gcc.gnu.org' Subject: [PATCH][Cilkplus] Remove unwanted static chain. Hello Everyone, This patch is for the Cilk Plus branch affecting mainly the C++ compiler. This patch will store the initial value of a loop correctly and remove the unnecessary static chain usage for some cases of Cilk_for. Thanks, Balaji V. Iyer. Index: gcc/cp/parser.c =================================================================== --- gcc/cp/parser.c (revision 190195) +++ gcc/cp/parser.c (working copy) @@ -28351,6 +28351,13 @@ FOR_EXPR (statement) = decl; CILK_FOR_GRAIN (statement) = grain; + /* If an initial value is available, and it is of type integer, then we + save it in CILK_FOR_INIT. */ + if (init && TREE_TYPE (init) && INTEGRAL_TYPE_P (TREE_TYPE (init))) + CILK_FOR_INIT (statement) = init; + else + CILK_FOR_INIT (statement) = NULL_TREE; + finish_cilk_for_init_stmt (statement); if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA)) Index: gcc/cp/ChangeLog.cilk =================================================================== --- gcc/cp/ChangeLog.cilk (revision 190195) +++ gcc/cp/ChangeLog.cilk (working copy) @@ -1,3 +1,7 @@ +2012-08-07 Balaji V. Iyer + + * parser.c (cp_parser_cilk_for): Stored the initial value in cilk_for tree. + 2012-08-01 Balaji V. Iyer * parser.c (cp_parser_userdef_char_literal): Replaced CALL_SPAWN and