From patchwork Wed Oct 28 21:58:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cesar Philippidis X-Patchwork-Id: 537581 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 369A0140770 for ; Thu, 29 Oct 2015 08:58:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=i8VQRmYp; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=kNQHRvFoCTKVnBP39M6hfjOm+GSSU9RSBC4j8WFZq2Eq1WlLqh ljhZTpMOfuHiynLWXK3rGoEW4a3JVbPGtUpJqDZIz2y4O/6FeWqEeX5qeu1JHTBP VDMHhIGVOwNjHWhsN7jSuEDajwvobXsAVl5f5sjST5rZ8XmUk3Vgt+yRs= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=YvhbYehyxjDazGmboNZKlC0ftvE=; b=i8VQRmYpcX2WGwbJ1371 jTgL+cKj/Bj+hZHPRjz6TpKlvKZ7Mg5fCKOGYFpAIp8/qYNvuntZQN+nQm6X4tSz qfpF6I8P8pui59H0oyqse0ZOyaaJVgdfg9I+fEvD9WpiMlijE4xuxrE9zDDe6d+g vZ8Q0eqeYOpzLKvE9DZDlv0= Received: (qmail 6076 invoked by alias); 28 Oct 2015 21:58:22 -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 6062 invoked by uid 89); 28 Oct 2015 21:58:21 -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, 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; Wed, 28 Oct 2015 21:58:20 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZrYjZ-000450-Ec from Cesar_Philippidis@mentor.com for gcc-patches@gcc.gnu.org; Wed, 28 Oct 2015 14:58:17 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.3.224.2; Wed, 28 Oct 2015 14:58:17 -0700 To: "gcc-patches@gcc.gnu.org" From: Cesar Philippidis Subject: [gomp4] minor cfe backports Message-ID: <563144F8.4010205@codesourcery.com> Date: Wed, 28 Oct 2015 14:58:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 I've applied this patch which backports a change in the way that seq and auto are parsed in the c front end from trunk to gomp4. Next up, I'm preparing a patch to remove *_omp_positive_int_clause from the c and c++ front ends in gomp4. That function is used to parse num_threads, num_gangs, num_workers and vector_length in gomp4. But support for those clauses are already present in trunk. I'll post more details with the patch later. Cesar 2015-10-28 Cesar Philippidis * gcc/c/c-parser.c (c_parser_oacc_simple_clause): New function. (c_parser_oacc_all_clauses): Use it instead of c_parser_omp_simple_clause. diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index a1465bf..e4a0aca 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -11365,7 +11365,25 @@ c_parser_oacc_shape_clause (c_parser *parser, omp_clause_code kind, cleanup_error: c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, 0); - return list; return c; + return list; +} + +/* OpenACC: + auto + independent + nohost + seq */ + +static tree +c_parser_oacc_simple_clause (c_parser *parser, enum omp_clause_code code, + tree list) +{ + check_no_duplicate_clause (list, code, omp_clause_code_name[code]); + + tree c = build_omp_clause (c_parser_peek_token (parser)->location, code); + OMP_CLAUSE_CHAIN (c) = list; + + return c; } /* OpenACC: @@ -12724,7 +12742,7 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask, c_name = "async"; break; case PRAGMA_OACC_CLAUSE_AUTO: - clauses = c_parser_omp_simple_clause (parser, OMP_CLAUSE_AUTO, + clauses = c_parser_oacc_simple_clause (parser, OMP_CLAUSE_AUTO, clauses); c_name = "auto"; break; @@ -12848,7 +12866,7 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask, c_name = "reduction"; break; case PRAGMA_OACC_CLAUSE_SEQ: - clauses = c_parser_omp_simple_clause (parser, OMP_CLAUSE_SEQ, + clauses = c_parser_oacc_simple_clause (parser, OMP_CLAUSE_SEQ, clauses); c_name = "seq"; break;