From patchwork Mon Mar 4 10:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 209499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp1339867dyc; Mon, 4 Mar 2024 02:51:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU0DB+zRlzXUY14x/o9Xu7irawpsJUmG9yXto0tOS1e+Cp1GJgbj2+ZbvbccTW+i7n2cbRyZTXai2cfG/xXKCEUsTSyHw== X-Google-Smtp-Source: AGHT+IGh9i7wQXbVRBuJmFEOCriRVcgqbuOEojw3kysnrYab3ynWxSC9+O4ZP0xz2dkVwium7q3P X-Received: by 2002:ac8:7f55:0:b0:42e:f5f0:28d5 with SMTP id g21-20020ac87f55000000b0042ef5f028d5mr1266589qtk.12.1709549472913; Mon, 04 Mar 2024 02:51:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709549472; cv=pass; d=google.com; s=arc-20160816; b=mDRUBfDxxi+f2JxFkw0wu22/IZ2aqWOefHcNq6GgKuZQVsCQ+qN61kYlECx6Nvxipi l3VHnottHiCT4xXT5GpS2CeuDqOQXCQkGYEZJ9fb3qVdMKPkF0EQPskrYnNevetlhmBq PNCILjWmAHbdryjioQJeVlQJ6ALT6GFV4WWASOe69cIcJaYNDsXHfZT7X6dnuktVxdjp bHe87FkL7pYhLHmNvZxwJBhxnI3Q2/hUNjbevk8jLBr5WMAr9S22w1fb8MU1lWKbym6a Tb25j/7jNY8XoAkI/bMcItAPKglqybHndWnogBV3KWejHJ3ungexG7WntBvKtAU1ePxe i35Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=seluRuFWlkNthKyXpLl9Gwf9ymkjPFsnSh1/k/3ZEjQ=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=FErDRqVjbG65cSrCagx3BCd2hk4HZr2J0JMeoi5Y8v3bCDjo4UgHlQ6prs6cbI/fsJ E18SfAiBOoU8rFlejrzSLEcz8s3s/wcyCE9i53ACX8QKsNkmb0b7HMduQpkHFAGE48kP YwiM9SI6QLKrMIda9txpgXe7onXUXmjnoVzsMlkV1Q5UeL7AYMfyzUxkz4/8dz4Ar89H dTYrMTyOwWolzDIYNlfx/U5Qn7zeUXBC6AbCcXkNqBUANB8e1Q4n5SUdhtwyBsvFElFA 1QJ8Y0arTkR7tmLJCnN5ujW0iVW3b/qPhAeUXd2tvA4v6lyVkuCSxpBwWM2l0m5QbPEK H6GQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fIkuuRWx; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t34-20020a05622a182200b0042e5ca4ce5asi9812026qtc.591.2024.03.04.02.51.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 02:51:12 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fIkuuRWx; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 93C46385840B for ; Mon, 4 Mar 2024 10:51:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AC8843858C50 for ; Mon, 4 Mar 2024 10:50:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AC8843858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AC8843858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709549403; cv=none; b=XXyJxa9VKV0R0jpreuFofp0m4v9xsgF6PACM8hpMM44W5rE227R2VWAChAIRt0CzPFnw6gwTB3fZhoB6Nuq72svJWw6a2/IvZbDP8wvKp5RKTuUXOi8t9ZMhv9z2+5RCTOYP7hXgfqBDAgHSICu8zBqkzWh9qTGPlf6enN9DvhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709549403; c=relaxed/simple; bh=0QceQAoaxTbeevFnq4sP2KIqtea/DxP5GjSzg9+ud3I=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=uX1+EF++r87pbDWPrxUSLFpbpKDiKBZWqe3oa/cegzqT0SC9cN07zn/bM2osL5CHMviT1H9dYQyCMaMW/bt/+/glzZGm0CUirYtvN/8U8Hp1sJwLU9NKj7yxqaCbCz/xDlWHUuPV3ojV/YJ3BcQdSv6igAOey03x8vy+w6GdSMM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709549401; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type; bh=seluRuFWlkNthKyXpLl9Gwf9ymkjPFsnSh1/k/3ZEjQ=; b=fIkuuRWx1AQ7EDK2TO4ZzuiNfM9K2nLKYcRzfprG2Jk7akmQD2YKd0r9E9Li3NtGhwhmFv idlhYg2kQkxGuPUPIAbyWoCG/m7IwTReo0J5HujcUMAccbAsG7cEpo+F7e+tMciN3msuC7 wds2BYipg1H+3KrLqAUgpmdtNPuE82M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-299-W6dQMxxXNbK636FLZ1hHjA-1; Mon, 04 Mar 2024 05:49:59 -0500 X-MC-Unique: W6dQMxxXNbK636FLZ1hHjA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D8A0D106522C for ; Mon, 4 Mar 2024 10:49:58 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.226.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F22C4400D for ; Mon, 4 Mar 2024 10:49:58 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 424AnumI1794869 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Mon, 4 Mar 2024 11:49:57 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 424AnuI31794868 for gcc-patches@gcc.gnu.org; Mon, 4 Mar 2024 11:49:56 +0100 Date: Mon, 4 Mar 2024 11:49:56 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] libgomp: Use void (*) (void *) rather than void (*)() for host_fn type [PR114216] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792592548173112078 X-GMAIL-MSGID: 1792592548173112078 Hi! 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. Tested on x86_64-linux, committed to trunk. 2024-03-04 Jakub Jelinek PR libgomp/114216 * target.c (gomp_target_rev): Change host_fn type and corresponding cast from void (*)() to void (*) (void *). Jakub --- libgomp/target.c.jj 2024-01-03 12:07:47.812094729 +0100 +++ libgomp/target.c 2024-03-04 11:26:05.745094586 +0100 @@ -3447,7 +3447,7 @@ gomp_target_rev (uint64_t fn_ptr, uint64 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) {