From patchwork Wed Jul 15 15:27:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 495886 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 A8A4F1402A6 for ; Thu, 16 Jul 2015 01:27:27 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=mW9vB6iA; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-transfer-encoding:in-reply-to; q=dns; s= default; b=qkANP/cwNbfl9n3ZM+j67yhrVwTQnrc0Nca6QB3LW6Zip5RrGSSpz RU0YQzkAkaHV4TW/U4DGxKazXYpo4YBpxr0Saq9AssJwBiL5+IXsxDjpolKod8iV ALEW743CeXLSR2JCP8iMCrTmWtZhUgyj4EWFc/TSfDs8EPha6sD9fQ= 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:date :from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=default; bh=lLsuZVFuqpgTvA+ulgOWGaPmLIU=; b=mW9vB6iAybcum20ynwduwSF9PPNQ qqW/GZetXyPfIJIfmPQP+8F3AgLYlOQWz0pZmsIcU8gIsZp7REFZBW/ThefAanDy UrcHahE/zBON2qJP/Xw/xj7uupiDjDBau4rDpiA5rTzrw9OR2Wcd+qrGt6VNUD0U a10Np2d0wUTQx2I= Received: (qmail 113798 invoked by alias); 15 Jul 2015 15:27:21 -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 113788 invoked by uid 89); 15 Jul 2015 15:27:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham 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; Wed, 15 Jul 2015 15:27:19 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D3946373BD1; Wed, 15 Jul 2015 15:27:17 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6FFRGap023436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 15 Jul 2015 11:27:17 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t6FFREfM019570; Wed, 15 Jul 2015 17:27:15 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t6FFREj8019569; Wed, 15 Jul 2015 17:27:14 +0200 Date: Wed, 15 Jul 2015 17:27:14 +0200 From: Jakub Jelinek To: Ilya Verbin Cc: gcc-patches@gcc.gnu.org Subject: Re: [gomp4.1] Support C++ "this" in OpenMP directives Message-ID: <20150715152714.GZ1788@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20150709085014.GK10247@tucnak.redhat.com> <20150715124754.GA39852@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150715124754.GA39852@msticlxl57.ims.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On Wed, Jul 15, 2015 at 03:47:54PM +0300, Ilya Verbin wrote: > On Thu, Jul 09, 2015 at 10:50:14 +0200, Jakub Jelinek wrote: > > * parser.c (cp_parser_omp_var_list_no_open): Parse this. > > * cp-tree.h (finish_omp_declare_simd_methods): New prototype. > > * semantics.c (handle_omp_array_sections_1): Disallow this based > > array sections for OpenMP. > > (finish_omp_declare_simd_methods): New function. > > (finish_omp_clauses): Don't attempt to adjust linear step of > > this if it points to TYPE_BEING_DEFINED. Disallow this in > > all clauses expecting variable lists, except for declare simd > > linear/uniform/aligned clauses. > > (finish_struct_1): Call finish_omp_declare_simd_methods. > > > > * g++.dg/vect/simd-clone-2.cc: New test. > > * g++.dg/vect/simd-clone-2.h: New file. > > * g++.dg/vect/simd-clone-3.cc: New test. > > * g++.dg/vect/simd-clone-4.cc: New test. > > * g++.dg/vect/simd-clone-4.h: New file. > > * g++.dg/vect/simd-clone-5.cc: New test. > > * g++.dg/gomp/this-1.C: New test. > > * g++.dg/gomp/this-2.C: New test. > > One more warning: > > gcc/cp/parser.c: In function ‘tree_node* cp_parser_omp_var_list_no_open(cp_parser*, omp_clause_code, tree, bool*)’: > gcc/cp/parser.c:27931:26: error: ‘name’ may be used uninitialized in this function [-Werror=maybe-uninitialized] > token->location); > ^ > cc1plus: all warnings being treated as errors > make[4]: *** [cp/parser.o] Error 1 Thanks, here is a fix: 2015-07-15 Jakub Jelinek * parser.c (cp_parser_omp_var_list_no_open): Don't process RID_THIS for kind == 0. Don't call cp_parser_name_lookup_error if finish_this_expr returned error_mark_node. Jakub --- gcc/parser.c (revision 225817) +++ gcc/parser.c (working copy) @@ -27910,7 +27910,9 @@ cp_parser_omp_var_list_no_open (cp_parse tree name, decl; token = cp_lexer_peek_token (parser->lexer); - if (current_class_ptr && cp_parser_is_keyword (token, RID_THIS)) + if (kind != 0 + && current_class_ptr + && cp_parser_is_keyword (token, RID_THIS)) { decl = finish_this_expr (); if (TREE_CODE (decl) == NON_LVALUE_EXPR @@ -27929,10 +27931,12 @@ cp_parser_omp_var_list_no_open (cp_parse goto skip_comma; decl = cp_parser_lookup_name_simple (parser, name, token->location); + if (decl == error_mark_node) + cp_parser_name_lookup_error (parser, name, decl, NLE_NULL, + token->location); } if (decl == error_mark_node) - cp_parser_name_lookup_error (parser, name, decl, NLE_NULL, - token->location); + ; else if (kind != 0) { switch (kind)