From patchwork Fri Sep 9 11:50:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1115 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp675451wrt; Fri, 9 Sep 2022 04:51:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR63WulmJYr8cLKAbFeq/GkjGrNcZmCoZYozhHcEQYI49w/VIQBG5xBTDNySiCpU8i8mK+Eo X-Received: by 2002:a17:907:dab:b0:742:5e2e:6e4 with SMTP id go43-20020a1709070dab00b007425e2e06e4mr9405274ejc.338.1662724279220; Fri, 09 Sep 2022 04:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662724279; cv=none; d=google.com; s=arc-20160816; b=guVv8GL+e15EIi2E/8gEzGFwTl2RU4rUYLnnffnWFK6qqPLdARe2qfSnAtQVXiqRD1 ckAdmjihVhtSXe3AbLiW9R0gV19i1zM2PaGXlXgjWxnSP/soQu56vltezczRL3xotrV1 NUitqYHiv9DTgs9Qptam6RmEbtsXYp3XT69NB98krx9LoNuq5wMUQn+ktRtzT+n0ZN1X ceGywUemrietCFPCM0lNCMJ8G2mpGKtqBlUeUU6qLkYD37eTzFZoHkv/AgjFCgMEPIzh tbLI3MDZDY8kA1IjGSfjcJRCclwSFeION4eE9VL8NJFFAY2dzaiMqymDCQ40QvzcI1uE gd2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-disposition:in-reply-to:mime-version:references:message-id :subject:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=n/dDu17x45rjU1YiKqNhwqFRgx6DYsrBSAMhdUH5D6c=; b=ISF/jFy+pR5RfxTjmVEXLRresiKh92O/UllAh9bzp+3/cbxYjTOOmKVk5BkcUf6Lhs 8wtKMD6OFITdjvScng40HER9uiiF2fEXB67Lv0lWKNtSqWOzq6ViBKIe/U2FdUehdPz1 84Ak/wlnIjaCA3T+/JqVkad74y3423zTD8BocsSNIFesDHDSfloUw4Nvzbcoqo0qFQZ3 3GmMo+EXnP/0mYTdXOSBhaFA7Ol8xGNIp+Wja+AEoPEVwIe6HuRZ8o0foOQgZN033u8E wS3fv0D/zIXoZRqnInOjegmArqb9DGbLVhv4YJplaUtGIki3UXF2/HTepVs05DweyKdR cRjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SzcJmATq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a18-20020a17090682d200b007386f4ab2a2si220976ejy.638.2022.09.09.04.51.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 04:51:19 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SzcJmATq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 054AF3857014 for ; Fri, 9 Sep 2022 11:51:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 054AF3857014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662724278; bh=n/dDu17x45rjU1YiKqNhwqFRgx6DYsrBSAMhdUH5D6c=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=SzcJmATqb9fx3x5+XUNywQ/HHKIEiGuhV01NZWVle4GJn+p0l7olhsrrMRkKgfkyS yfkQ9IFwzPzkTewx2D2097NRfIF+iubl2g5wnRTBTTaKPH2MLqGOubE8hYRjKba5mk mcSk0j6zIZYHLzu7aaZO0ldj6I7qQV1WMtmVlPNg= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 5D60738582BF for ; Fri, 9 Sep 2022 11:50:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5D60738582BF Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-114-O3s7-uyJN4KhnbsMuWCsYg-1; Fri, 09 Sep 2022 07:50:31 -0400 X-MC-Unique: O3s7-uyJN4KhnbsMuWCsYg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9485E3C0F366; Fri, 9 Sep 2022 11:50:31 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 55B351121315; Fri, 9 Sep 2022 11:50:31 +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 289BoSCc1596105 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 9 Sep 2022 13:50:28 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 289BoR581596104; Fri, 9 Sep 2022 13:50:27 +0200 Date: Fri, 9 Sep 2022 13:50:26 +0200 To: Marcel Vollweiler Subject: [committed] libgomp: Fix up OMP_PROC_BIND handling [PR106894] Message-ID: References: <392c847d-e798-2be3-a808-6888de6c90cd@codesourcery.com> <73621930-22ce-c3f1-61e0-f15683f8b281@codesourcery.com> <055f7cfb-2849-ba5a-a161-13333e19e538@codesourcery.com> <7dc0eaf0-a3ed-8145-c43a-e9bb063f6acd@codesourcery.com> MIME-Version: 1.0 In-Reply-To: <7dc0eaf0-a3ed-8145-c43a-e9bb063f6acd@codesourcery.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: Tobias Burnus , gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1743492773607705800?= X-GMAIL-MSGID: =?utf-8?q?1743492773607705800?= On Wed, Aug 31, 2022 at 12:56:25PM +0200, Marcel Vollweiler wrote: > + case PARSE_BIND: > + *(char *) (host_envvars[omp_var].dest[0]) > + = *(char *) params[0]; > + *(char *) (host_envvars[omp_var].dest[1]) > + = *(char *) params[1]; > + *(unsigned long *) (host_envvars[omp_var].dest[2]) > + = *(unsigned long *) params[2]; While the first param is char (gomp_global_icv.bind_var), the second param is char * (gomp_bind_var_list), so we shouldn't access it through *(char *). Tested on x86_64-linux with make check RUNTESTFLAGS="c.exp='*affinity* icv-6.c *display*' c++.exp='*affinity* icv-6.c *display*' fortran.exp='*affinity*'" which previously had various failures, committed to trunk. 2022-09-09 Jakub Jelinek PR libgomp/106894 * env.c (initialize_env) : Use char ** instead of char * for dest[1] initialization from params[1]. Formatting fixes. Jakub --- libgomp/env.c.jj 2022-09-08 20:22:07.849183684 +0200 +++ libgomp/env.c 2022-09-09 13:30:14.090107492 +0200 @@ -2184,12 +2184,10 @@ initialize_env (void) *(int *) (host_envvars[omp_var].dest[1]) = *(int *) params[1]; break; case PARSE_BIND: - *(char *) (host_envvars[omp_var].dest[0]) - = *(char *) params[0]; - *(char *) (host_envvars[omp_var].dest[1]) - = *(char *) params[1]; + *(char *) (host_envvars[omp_var].dest[0]) = *(char *) params[0]; + *(char **) (host_envvars[omp_var].dest[1]) = *(char **) params[1]; *(unsigned long *) (host_envvars[omp_var].dest[2]) - = *(unsigned long *) params[2]; + = *(unsigned long *) params[2]; break; } }