From patchwork Tue Feb 14 22:44:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 65024 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 536433858413 for ; Tue, 14 Feb 2023 22:44:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 1BDA43858D33 for ; Tue, 14 Feb 2023 22:44:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BDA43858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.97,297,1669104000"; d="scan'208,223";a="100776414" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 14 Feb 2023 14:44:31 -0800 IronPort-SDR: WXGDEqF2aidRIS+iR6wvvYVyJP+7DhI2bgoVI2v3VE6WThZ9V9fga+CB66PDjlaVEQIRMEmO2V 0DECRR4PonTtEA9/3bgIVF5bfRZruedelLUrf5+XpB0kqc3V0JnUgoFFudDpQ8Qj5O5DALsoA6 NrbnyPb23wE5xrTuWSV7E99gjQEeUPCPtMquoHpItKz5x5gg2EVjy6pftnrjUVYYK1JjdgbiSm n8QH9IgghziPYFpzfkhACxpkvKLMiTfodkWjSMdzxHoCgaURX0uU2Njo33AdP1fvK3X/jImXkz Bx4= From: Thomas Schwinge To: Kwok Cheung Yeung , Subject: [og12] Address cast to pointer from integer of different size in 'libgomp/target.c:gomp_target_rev' (was: [OG12][committed] openmp: Add support for the 'present' modifier) In-Reply-To: <049a4654-2596-1913-20fc-1aeea48eb3ec@codesourcery.com> References: <049a4654-2596-1913-20fc-1aeea48eb3ec@codesourcery.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Tue, 14 Feb 2023 23:44:24 +0100 Message-ID: <87sff73m0n.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! On 2023-02-09T21:17:44+0000, Kwok Cheung Yeung wrote: > I've ported my patch for supporting the OpenMP 5.1 'present' modifier > and committed it to the devel/omp/gcc-12 development branch: > > 229b705862c openmp: Add support for the 'present' modifier > > Tested with offloading on amdgcn and nvptx. I've pushed to devel/omp/gcc-12 branch commit cd377354c5faa326bdfa5f10e4193c1d1a686801 "Address cast to pointer from integer of different size in 'libgomp/target.c:gomp_target_rev'", see attached. Note that this likewise applies to the current upstream submission: "openmp: Add support for 'present' modifier". Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From cd377354c5faa326bdfa5f10e4193c1d1a686801 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 14 Feb 2023 23:34:45 +0100 Subject: [PATCH] Address cast to pointer from integer of different size in 'libgomp/target.c:gomp_target_rev' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For example, for '-m32' multilib of x86_64-pc-linux-gnu: [...]/libgomp/target.c: In function ‘gomp_target_rev’: [...]/libgomp/target.c:3699:33: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 3699 | (void *) devaddrs[i], | ^ Fix-up for recent og12 commit 229b705862c1d7f9634f72272b77c22970baf821 "openmp: Add support for the 'present' modifier". libgomp/ * target.c (gomp_target_rev): Address cast to pointer from integer of different size. --- libgomp/ChangeLog.omp | 5 +++++ libgomp/target.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp index 484367d9975..67065f59922 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,8 @@ +2023-02-14 Thomas Schwinge + + * target.c (gomp_target_rev): Address cast to pointer from integer + of different size. + 2023-02-09 Kwok Cheung Yeung * target.c (gomp_to_device_kind_p): Add map kinds with 'present' diff --git a/libgomp/target.c b/libgomp/target.c index 426383a451b..6edfc9214e4 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -3696,12 +3696,12 @@ gomp_target_rev (uint64_t fn_ptr, uint64_t mapnum, uint64_t devaddrs_ptr, #ifdef HAVE_INTTYPES_H gomp_fatal ("present clause: no corresponding data on " "parent device at %p with size %"PRIu64, - (void *) devaddrs[i], + (void *) (uintptr_t) devaddrs[i], (uint64_t) sizes[i]); #else gomp_fatal ("present clause: no corresponding data on " "parent device at %p with size %lu", - (void *) devaddrs[i], + (void *) (uintptr_t) devaddrs[i], (unsigned long) sizes[i]); #endif break; -- 2.25.1