From patchwork Wed Mar 25 12:35:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 454380 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 774A61400EA for ; Wed, 25 Mar 2015 23:35:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=RVxPD4sN; dkim-adsp=none (unprotected policy); 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 :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=PrpsGSBBRE0wXPFA/rVcLuSiEnbmP66SvjvxscjwJ1qzpq I4fnS1ZNuTGIrbMy1wcJR7tEYUxRSh35qUm2R+CZ7vk5EzVmZ6GbdyecMXW1igpw +SFHpGjUjfa0f4aJvOQyNkvgBSFj7GThJdiMjbLo0bUtluhzYTjxYhxTelM2Y= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=kicpmQB5kCJeK1oEvahLFD+59jQ=; b=RVxPD4sNf9MQfpl0vz8M WrCHlOwZmvgtzplbGMw4eDoDmD7V+7pH9E2g2ft4G+LcTWIH90nPRkLJ8Lf9Z1Ep KBRqJhAcIZRSSZtBXjbrM3n5pkaOhU9S0o1ccTwgG+HorfcDIBdkmkgZNHsnBm77 lvH1A8pY7qXS7jY/ln6xBAA= Received: (qmail 9716 invoked by alias); 25 Mar 2015 12:35:07 -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 9707 invoked by uid 89); 25 Mar 2015 12:35:06 -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, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f180.google.com Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 25 Mar 2015 12:35:05 +0000 Received: by wibg7 with SMTP id g7so107885411wib.1 for ; Wed, 25 Mar 2015 05:35:02 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.73.146 with SMTP id l18mr23122875wiv.89.1427286902815; Wed, 25 Mar 2015 05:35:02 -0700 (PDT) Received: by 10.28.147.207 with HTTP; Wed, 25 Mar 2015 05:35:02 -0700 (PDT) Date: Wed, 25 Mar 2015 13:35:02 +0100 Message-ID: Subject: [patch libgomp]: Fix PR 64972 From: Kai Tietz To: GCC Patches X-IsSubscribed: yes Hi, ChangeLog 2015-03-25 Kai Tietz PR libgomp/64972 * oacc-parallel.c (GOACC_parallel): Use PRIu64 if available. (GOACC_data_start): Likewise. * target.c (gomp_map_vars): Likewise. Tested for i686-w64-mingw32. Fix got preapproved by Jakub, so I will commit this soon, if there are no objections. Regards, Kai Index: oacc-parallel.c =================================================================== --- oacc-parallel.c (Revision 221640) +++ oacc-parallel.c (Arbeitskopie) @@ -31,6 +31,9 @@ #include "libgomp_g.h" #include "gomp-constants.h" #include "oacc-int.h" +#ifdef HAVE_INTTYPES_H +# include /* For PRIu64. */ +#endif #include #include #include @@ -99,9 +102,15 @@ GOACC_parallel (int device, void (*fn) (void *), gomp_fatal ("num_workers (%d) different from one is not yet supported", num_workers); - gomp_debug (0, "%s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n", - __FUNCTION__, mapnum, hostaddrs, sizes, kinds, async); - +#ifdef HAVE_INTTYPES_H + gomp_debug (0, "%s: mapnum=%"PRIu64", hostaddrs=%p, size=%p, kinds=%p, " + "async = %d\n", + __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds, async); +#else + gomp_debug (0, "%s: mapnum=%lu, hostaddrs=%p, sizes=%p, kinds=%p, async=%d\n", + __FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds, + async); +#endif select_acc_device (device); thr = goacc_thread (); @@ -178,8 +187,13 @@ GOACC_data_start (int device, size_t mapnum, bool host_fallback = device == GOMP_DEVICE_HOST_FALLBACK; struct target_mem_desc *tgt; - gomp_debug (0, "%s: mapnum=%zd, hostaddrs=%p, sizes=%p, kinds=%p\n", - __FUNCTION__, mapnum, hostaddrs, sizes, kinds); +#ifdef HAVE_INTTYPES_H + gomp_debug (0, "%s: mapnum=%"PRIu64", hostaddrs=%p, size=%p, kinds=%p\n", + __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds); +#else + gomp_debug (0, "%s: mapnum=%lu, hostaddrs=%p, sizes=%p, kinds=%p\n", + __FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds); +#endif select_acc_device (device); Index: target.c =================================================================== --- target.c (Revision 221640) +++ target.c (Arbeitskopie) @@ -33,6 +33,9 @@ #include #include #include +#ifdef HAVE_INTTYPES_H +# include /* For PRIu64. */ +#endif #include #include @@ -438,9 +441,16 @@ gomp_map_vars (struct gomp_device_descr *devicep, /* We already looked up the memory region above and it was missing. */ size_t size = k->host_end - k->host_start; +#ifdef HAVE_INTTYPES_H gomp_fatal ("present clause: !acc_is_present (%p, " - "%zd (0x%zx))", (void *) k->host_start, - size, size); + "%"PRIu64" (0x%"PRIx64"))", + (void *) k->host_start, + (uint64_t) size, (uint64_t) size); +#else + gomp_fatal ("present clause: !acc_is_present (%p, " + "%lu (0x%lx))", (void *) k->host_start, + (unsigned long) size, (unsigned long) size); +#endif } break; case GOMP_MAP_FORCE_DEVICEPTR: