From: Thomas Schwinge <thomas@codesourcery.com>
To: Kwok Cheung Yeung <kcy@codesourcery.com>, <gcc-patches@gcc.gnu.org>
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)
Date: Tue, 14 Feb 2023 23:44:24 +0100 [thread overview]
Message-ID: <87sff73m0n.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <049a4654-2596-1913-20fc-1aeea48eb3ec@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]
Hi!
On 2023-02-09T21:17:44+0000, Kwok Cheung Yeung <kcy@codesourcery.com> 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:
<https://inbox.sourceware.org/gcc-patches/6eb5d0dd-da2a-6d8e-eaa2-d14bf708cf36@codesourcery.com>
"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
[-- Attachment #2: 0001-Address-cast-to-pointer-from-integer-of-different-si.patch --]
[-- Type: text/x-diff, Size: 2259 bytes --]
From cd377354c5faa326bdfa5f10e4193c1d1a686801 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
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 <thomas@codesourcery.com>
+
+ * target.c (gomp_target_rev): Address cast to pointer from integer
+ of different size.
+
2023-02-09 Kwok Cheung Yeung <kcy@codesourcery.com>
* 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
next prev parent reply other threads:[~2023-02-14 22:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 13:44 [PATCH] openmp: Add support for 'present' modifier Kwok Cheung Yeung
2023-02-09 21:17 ` [OG12][committed] openmp: Add support for the " Kwok Cheung Yeung
2023-02-14 22:44 ` Thomas Schwinge [this message]
2023-02-15 0:00 ` Kwok Cheung Yeung
2023-02-15 19:02 ` [og12] Fix 'libgomp.{c-c++-common,fortran}/target-present-*' test cases (was: [OG12][committed] openmp: Add support for the 'present' modifier) Thomas Schwinge
2023-06-07 11:25 ` [committed] testsuite/libgomp.*/target-present-*.{c,f90}: Improve and fix (was: Re: [og12] Fix 'libgomp.{c-c++-common,fortran}/target-present-*' test cases) Tobias Burnus
2023-06-07 11:26 ` Tobias Burnus
2023-06-12 16:44 ` [committed] OpenMP: Cleanups related to the 'present' modifier Tobias Burnus
2023-06-14 8:42 ` Thomas Schwinge
2023-06-14 10:00 ` Tobias Burnus
2023-02-17 11:45 ` [PATCHv2] openmp: Add support for " Kwok Cheung Yeung
2023-04-28 17:26 ` Tobias Burnus
2023-06-06 14:55 ` [committed] " Tobias Burnus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sff73m0n.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kcy@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).