From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13621 invoked by alias); 20 Oct 2014 20:19:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 13610 invoked by uid 89); 20 Oct 2014 20:19:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE 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; Mon, 20 Oct 2014 20:18:59 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1XgJPs-0000V8-3G from Cesar_Philippidis@mentor.com for gcc-patches@gcc.gnu.org; Mon, 20 Oct 2014 13:18:56 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.181.6; Mon, 20 Oct 2014 13:18:55 -0700 Message-ID: <54456E2E.8050701@codesourcery.com> Date: Mon, 20 Oct 2014 20:19:00 -0000 From: Cesar Philippidis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [gomp4] acc update bug Content-Type: multipart/mixed; boundary="------------080805040009000604080707" X-SW-Source: 2014-10/txt/msg01968.txt.bz2 --------------080805040009000604080707 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-length: 318 The OpenACC update directive would cause an ICE if there was an error parsing one of its clauses in the c front end. E.g. #pragma acc update copy(a(1:10)). This patch fixes that. Also, it declare GOACC_update inside libgomp_g.h I've committed this patch to gomp-4_0-branch. A test case will be provided later. Cesar --------------080805040009000604080707 Content-Type: text/x-patch; name="bugfix-update.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bugfix-update.diff" Content-length: 1200 2014-10-20 Cesar Philippidis gcc/c/ * c-parser.c (c_parser_oacc_update): Don't create a new stmt if the pragma is bogus. libgomp/ * (GOACC_update): Declare. diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 17085bf..d1956b8 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -12071,6 +12071,9 @@ c_parser_oacc_update (c_parser *parser) return; } + if (parser->error) + return; + tree stmt = make_node (OACC_UPDATE); TREE_TYPE (stmt) = void_type_node; OACC_UPDATE_CLAUSES (stmt) = clauses; diff --git a/libgomp/libgomp_g.h b/libgomp/libgomp_g.h index 44f200c..35b0627 100644 --- a/libgomp/libgomp_g.h +++ b/libgomp/libgomp_g.h @@ -225,6 +225,10 @@ extern void GOACC_kernels (int, void (*) (void *), const void *, extern void GOACC_parallel (int, void (*) (void *), const void *, size_t, void **, size_t *, unsigned short *, int, int, int, int, int, ...); +extern void GOACC_update (int device, const void *openmp_target, size_t mapnum, + void **hostaddrs, size_t *sizes, + unsigned short *kinds, int async, + int num_waits, ...); extern void GOACC_wait (int, int, ...); #endif /* LIBGOMP_G_H */ --------------080805040009000604080707--