public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9294] libgomp: Use void (*) (void *) rather than void (*)() for host_fn type [PR114216]
Date: Mon,  4 Mar 2024 10:48:47 +0000 (GMT)	[thread overview]
Message-ID: <20240304104847.6BDF8385840E@sourceware.org> (raw)

https://gcc.gnu.org/g:dea9ac2a00d1e4126d61b65a8302c2bd523f0b99

commit r14-9294-gdea9ac2a00d1e4126d61b65a8302c2bd523f0b99
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Mar 4 11:40:27 2024 +0100

    libgomp: Use void (*) (void *) rather than void (*)() for host_fn type [PR114216]
    
    For the type of the target callbacks we use elsehwere void (*) (void *) and
    IMHO should use that for the reverse offload fallback as well (where the actual
    callback is emitted using the same code as for host fallback or device kernel
    entry routines), even when it is also ok to use void (*) () before C23 and
    we aren't building libgomp with C23 yet.  On some arches perhaps void (*) ()
    could result in worse code generation because calls in that case like casts
    to unprototyped functions need to sometimes pass argument in two different spots
    etc. so that it deals with both passing it through ... and as a named argument.
    
    2024-03-04  Jakub Jelinek  <jakub@redhat.com>
    
            PR libgomp/114216
            * target.c (gomp_target_rev): Change host_fn type and corresponding
            cast from void (*)() to void (*) (void *).

Diff:
---
 libgomp/target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgomp/target.c b/libgomp/target.c
index 1367e9cce6c..bcc86051601 100644
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -3447,7 +3447,7 @@ gomp_target_rev (uint64_t fn_ptr, uint64_t mapnum, uint64_t devaddrs_ptr,
 
   if (n == NULL)
     gomp_fatal ("Cannot find reverse-offload function");
-  void (*host_fn)() = (void (*)()) n->k->host_start;
+  void (*host_fn) (void *) = (void (*) (void *)) n->k->host_start;
 
   if ((devicep->capabilities & GOMP_OFFLOAD_CAP_SHARED_MEM) || mapnum == 0)
     {

                 reply	other threads:[~2024-03-04 10:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240304104847.6BDF8385840E@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).