From patchwork Thu Nov 12 16:11:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 543423 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 65095141301 for ; Fri, 13 Nov 2015 03:12:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=sPKPYMiG; 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=rqxdb7Ayi+KYaWOf LbbYKSLfFVoNzLM9Be0XcaIiK7hqhl4mmsricbEzva6SdhqLouDBCVEg3+SVHkoa KavfAbqsKrQv+kTdIB8I25xFxPN3H44anmhjzgJmApa6ots2nUCaG3XomLI03CAT h+wsUWpJc9xYAmaC5vvmzxQ7gwg= 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:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=wFcGQYloEH9rMpugeCVYIm cKNxs=; b=sPKPYMiGZFuIgb7SOx1ZpB4SBMsxbuYjSwK5fWIldFKNEWvXqn8TMK yF4gIiRdtW9zlIhc8imJGMNL1iPbWsJ+/6BsfQboRLtHt2nh6ARX29PDy+9DR75h GYbdbreQsoh1r/dxZ5zstaWggD34Oy/ohhq0aIbv8QVGY2XOkpAwM= Received: (qmail 46165 invoked by alias); 12 Nov 2015 16:12:03 -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 46152 invoked by uid 89); 12 Nov 2015 16:12:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Nov 2015 16:12:01 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZwuTe-0004il-7O from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Thu, 12 Nov 2015 08:11:58 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Thu, 12 Nov 2015 16:11:57 +0000 From: Thomas Schwinge To: Nathan Sidwell , GCC Patches CC: Cesar Philippidis Subject: Re: [gomp4] remove c++ reference restriction In-Reply-To: <56449C3E.4040108@acm.org> References: <87sib0jivr.fsf@schwinge.name> <56449C3E.4040108@acm.org> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 12 Nov 2015 17:11:53 +0100 Message-ID: <878u6319km.fsf@schwinge.name> MIME-Version: 1.0 Hi Nathan! On Thu, 12 Nov 2015 09:03:42 -0500, Nathan Sidwell wrote: > I've applied this to gomp4 branch. It removes the machinery concerning c++ > references. The openacc std makes no mention of such a type, so originally we > were not permitting the type. But, > (a) OpenMP supports them, which suggests openacc wishes to > (b) Fortran already has reference types that need supporting > (c) it's more work to not support them, by modifying the mappable_type hook. ACK. "For reference", your and Cesar's original reasoning had been that the OpenACC 2.0a specification doesn't talk about reference types specifically, and they're non-POD, so not supported, which lead to Cesar's patch that I applied to gomp-4_0-branch in r223179, . Now, if they "just work", that's even better of course. > 2015-11-12 Nathan Sidwell That was incomplete however, so we got a testsuite regression because of: [...]/gcc/testsuite/g++.dg/goacc/reference.C: In function 'int test1(int&)': [...]/gcc/testsuite/g++.dg/goacc/reference.C:7:27: error: reference types are not supported in OpenACC [...]/gcc/testsuite/g++.dg/goacc/reference.C: In function 'int main()': [...]/gcc/testsuite/g++.dg/goacc/reference.C:36:33: error: reference types are not supported in OpenACC Fixed on gomp-4_0-branch in r230265: commit 6ec26341420b3ced11af5adbe4643ff6cfaf99eb Author: tschwinge Date: Thu Nov 12 16:09:47 2015 +0000 Complete reversion of "Prohibit C++ reference types in OpenACC regions" gcc/cp/ * semantics.c (finish_omp_clauses): Remove "reference types are not supported in OpenACC" diagnostic. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@230265 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog.gomp | 5 +++++ gcc/cp/semantics.c | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) Grüße Thomas diff --git gcc/cp/ChangeLog.gomp gcc/cp/ChangeLog.gomp index 1f19b39..e4d000d 100644 --- gcc/cp/ChangeLog.gomp +++ gcc/cp/ChangeLog.gomp @@ -1,3 +1,8 @@ +2015-11-12 Thomas Schwinge + + * semantics.c (finish_omp_clauses): Remove "reference types are + not supported in OpenACC" diagnostic. + 2015-11-12 Nathan Sidwell * semantics.c (finish_ommp_clauses): Adjust omp_mappable_type calls. diff --git gcc/cp/semantics.c gcc/cp/semantics.c index 34ccec6..ac3cb66 100644 --- gcc/cp/semantics.c +++ gcc/cp/semantics.c @@ -6552,11 +6552,6 @@ finish_omp_clauses (tree clauses, bool is_oacc, bool allow_fields, } break; } - if (is_oacc && TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE) - { - error_at (OMP_CLAUSE_LOCATION (c), - "reference types are not supported in OpenACC"); - } if (t == error_mark_node) { remove = true; @@ -6648,10 +6643,10 @@ finish_omp_clauses (tree clauses, bool is_oacc, bool allow_fields, == GOMP_MAP_FIRSTPRIVATE_POINTER))) && t == OMP_CLAUSE_DECL (c) && !type_dependent_expression_p (t) - && !cp_omp_mappable_type (((TREE_CODE (TREE_TYPE (t)) + && !cp_omp_mappable_type ((TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE) ? TREE_TYPE (TREE_TYPE (t)) - : TREE_TYPE (t)))) + : TREE_TYPE (t))) { error_at (OMP_CLAUSE_LOCATION (c), "%qD does not have a mappable type in %qs clause", t,