From patchwork Tue Mar 13 16:06:43 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: 146438 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 4973AB6EF1 for ; Wed, 14 Mar 2012 03:09:20 +1100 (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=1332259761; h=Comment: DomainKey-Signature:Received:Received: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=w3Nhb3oQa/Ibp3uwhlYTWncxA5A=; b=S82RTqYxYDXuqoz c4miPjKVgrR79GO95Z+WMUFF17HzrLaY94m+losRIf0QbYf/fFuvsPOo5Y/ca5Oj 4PcbukDd4a/UsLqHChbeARm7xBq0fTVbygU6EOc0/fIvK+qCpPlXH9MTtKjFmPgP zL8vHogqd1PM0wBwZblQsr9hPGqg= 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: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=cSn29G6XRE2O9SjvMJVukk9uVYVtZ5KLculgg2cFJX1F4vlpy0yCLi7EYn4K2Z XlHzFlKuitX+7BSGJkPu2i3fPLZhEakOUiUI6/n1Qo5Py/L+9jN3dgwjolLq1q8T +kN+PgljHKyTqWsg1wIFUZvx/XCI9Bz3HXRPVETnZPbRU=; Received: (qmail 23263 invoked by alias); 13 Mar 2012 16:09:03 -0000 Received: (qmail 23191 invoked by uid 22791); 13 Mar 2012 16:09:02 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, TW_TM, 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, 13 Mar 2012 16:08:49 +0000 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 13 Mar 2012 09:06:45 -0700 X-ExtLoop1: 1 Received: from azsmsx603.amr.corp.intel.com ([10.2.161.23]) by AZSMGA002.ch.intel.com with ESMTP; 13 Mar 2012 09:06:45 -0700 Received: from chspprodmsx101.amr.corp.intel.com (10.2.67.97) by azsmsx603.amr.corp.intel.com (10.2.161.23) with Microsoft SMTP Server (TLS) id 8.2.255.0; Tue, 13 Mar 2012 09:06:45 -0700 Received: from fmsmsx103.amr.corp.intel.com (10.19.9.34) by CHSPPRODMSX101.amr.corp.intel.com (10.2.67.97) with Microsoft SMTP Server (TLS) id 14.1.355.2; Tue, 13 Mar 2012 09:06:45 -0700 Received: from fmsmsx102.amr.corp.intel.com ([169.254.2.186]) by FMSMSX103.amr.corp.intel.com ([169.254.3.243]) with mapi id 14.01.0355.002; Tue, 13 Mar 2012 09:06:44 -0700 From: "Iyer, Balaji V" To: "gcc-patches@gcc.gnu.org" Subject: [PATCH][Cilkplus] Fix a bug in array notations Date: Tue, 13 Mar 2012 16:06:43 +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 Hello Everyone, This patch is for the Cilkplus branch mainly affecting the C compiler. It fixes a bug in function calls that take in array notations. Thanks, Balaji V. Iyer. Index: gcc/c-typeck.c =================================================================== --- gcc/c-typeck.c (revision 185342) +++ gcc/c-typeck.c (working copy) @@ -3274,7 +3274,10 @@ if (typetail != 0 && TREE_VALUE (typetail) != void_type_node) { - if (flag_enable_cilk && contains_array_notation_expr (function)) + if (flag_enable_cilk + && (contains_array_notation_expr (function) + || contains_array_notation_expr + (build_tree_list_vec (values)))) ; else { Index: gcc/c-array-notation.c =================================================================== --- gcc/c-array-notation.c (revision 185342) +++ gcc/c-array-notation.c (working copy) @@ -134,6 +134,15 @@ *array_list = new_array_list; return; } + else if (TREE_CODE (node) == TREE_LIST) + { + extract_array_notation_exprs (TREE_PURPOSE (node), ignore_builtin_fn, + array_list, list_size); + extract_array_notation_exprs (TREE_VALUE (node), ignore_builtin_fn, + array_list, list_size); + extract_array_notation_exprs (TREE_CHAIN (node), ignore_builtin_fn, + array_list, list_size); + } else if (TREE_CODE (node) == STATEMENT_LIST) { tree_stmt_iterator ii_tsi; Index: gcc/ChangeLog.cilk =================================================================== --- gcc/ChangeLog.cilk (revision 185342) +++ gcc/ChangeLog.cilk (working copy) @@ -1,3 +1,9 @@ +2012-03-12 Balaji V. Iyer + + * c-typeck.c (convert_arguments): Added array notation check for + funtion values. + * c-array-notation.c (extract_array_notation_exprs): Handled TREE_LIST. + 2012-03-11 Balaji V. Iyer * attribs.c (decl_attributes): Concatinated existing attributes with