From patchwork Tue Sep 13 17:05:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1187 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp2446400wrt; Tue, 13 Sep 2022 10:06:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR6SPcz976pIbA46xehusd5r6zxmyT4r7lZ5+l5vUaGitbybINDUi2W6qJnMoSyAmXreKR+I X-Received: by 2002:a17:907:94ca:b0:77b:542a:4cc4 with SMTP id dn10-20020a17090794ca00b0077b542a4cc4mr10936551ejc.257.1663088801433; Tue, 13 Sep 2022 10:06:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663088801; cv=none; d=google.com; s=arc-20160816; b=nTmFUWrAEI5oCGW4kCxCO6Uwv3Pws7FKMDgZnXlQ/8UcaG0KIoAt1diNSGZ6663cvc JkPTmMVJfdYmfD0KsomQo4GQAqKV4TrB3MQQpak3ngk7V9xXO0Cj6s0wuDKHlAmAcpH7 n9Bf0Oq7m7KJGZyr1yAkfUJbR+B+fYYM4cyIF9wd9GRHSkZprZyZ+qfAW0Ey3EuYkHzG MNNWYwYWtHnFsi8XtHQSwAcMdhRnO/8gBxLXxrmQOX6/rI1hsq1NVKpGcaqMtAPgaJRj QfgEGzD/7gE/+gbrdAPeBWZB0mIjeFHsmCGG0PUl3Ob+0SyxJZIdlVWSHx2MjZAcKYdF XtgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=KZLpFsjNM/4HEKZObTrti0y+2lF6zpY7SnitNff1Yq4=; b=HADhV8V7rJCHtgS5Ubg5XPCnxpIk9A6D6nb2ANejHcIJW1+/bq/BktSRAjK9PLOZIS ACmQVa3+zU0i+emBE3JPM2OFW/rwl0HB5dV4e8m3IiZ4/Itku9Yql0/+uelx0Mp7Eb0e R5eSVuQ7tescavnyzRw1YeFOKkyVMVa6kGu4zJ9c9q0iCUYQ/T7zowqL6SFtZps2dlDZ YzVi18anHqJBRoeXeDgpv6ssBid5CagnEBVndaU7hCgzTfswsWq4wxmBpKQekX/kI/3d +Q50mmK2f7073HEJORjsHZde7TQKYzpWWA4XZrQot+Rsqm8Nz/Xs/8xS2yelxtYIW1GH QfgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XWimBPQw; 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=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id hb19-20020a170907161300b0077ab7762eabsi9108357ejc.559.2022.09.13.10.06.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 10:06:41 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=XWimBPQw; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 05FFB385624D for ; Tue, 13 Sep 2022 17:06:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05FFB385624D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663088792; bh=KZLpFsjNM/4HEKZObTrti0y+2lF6zpY7SnitNff1Yq4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XWimBPQw3mYVjc0H/Zpgi6QFmwSS4WL+TEHzl5q0Nk6unaqgfyJiID8DQhoMvM13q YtvLtxDON6boYlcyck7wCOWwY+zaCnVEId7nB0V6nsDFsTnBTMVVrYzwkYYKAXaZzH XBwMTb0CVXQswzDzahc1ZqoGiKM7ElX6LZ+K8tCc= 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 BBDC93858D1E for ; Tue, 13 Sep 2022 17:05:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BBDC93858D1E 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-264-N6fhK4TaO-KYsrWxiaYnVw-1; Tue, 13 Sep 2022 13:05:45 -0400 X-MC-Unique: N6fhK4TaO-KYsrWxiaYnVw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8094B1C08973 for ; Tue, 13 Sep 2022 17:05:45 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4237649BB60 for ; Tue, 13 Sep 2022 17:05:45 +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 28DH5ajf150734 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 13 Sep 2022 19:05:36 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 28DH5ZFw150733 for gcc-patches@gcc.gnu.org; Tue, 13 Sep 2022 19:05:35 +0200 Date: Tue, 13 Sep 2022 19:05:35 +0200 To: gcc-patches@gcc.gnu.org Subject: [committed] libgomp: Appease some static analyzers [PR106906] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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 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?1743875002996267145?= X-GMAIL-MSGID: =?utf-8?q?1743875002996267145?= Hi! While icv_addr[1] = false; assignments where icv_addr has void * element type is correct and matches how it is used (in those cases the void * pointer is then cast to bool and used that way), there is no reason not to add explicit (void *) casts there which are there already for (void *) true. And, there is in fact even no point in actually doing those stores at all because we set that pointer to NULL a few lines earlier. So, this patch adds the explicit casts and then comments those out to show intent. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2022-09-13 Jakub Jelinek PR libgomp/106906 * env.c (get_icv_member_addr): Cast false to void * before assigning it to icv_addr[1], and comment the whole assignment out. Jakub --- libgomp/env.c.jj 2022-09-12 10:32:00.935086858 +0200 +++ libgomp/env.c 2022-09-12 13:27:22.893571697 +0200 @@ -1892,14 +1892,14 @@ get_icv_member_addr (struct gomp_initial { case GOMP_ICV_NTEAMS: icv_addr[0] = &icvs->nteams_var; - icv_addr[1] = false; + /* icv_addr[1] = (void *) false; */ break; case GOMP_ICV_DYNAMIC: icv_addr[0] = &(*icvs).dyn_var; break; case GOMP_ICV_TEAMS_THREAD_LIMIT: icv_addr[0] = &icvs->teams_thread_limit_var; - icv_addr[1] = false; + /* icv_addr[1] = (void *) false; */ break; case GOMP_ICV_SCHEDULE: icv_addr[0] = &icvs->run_sched_var; @@ -1907,7 +1907,7 @@ get_icv_member_addr (struct gomp_initial break; case GOMP_ICV_THREAD_LIMIT: icv_addr[0] = &icvs->thread_limit_var; - icv_addr[1] = false; + /* icv_addr[1] = (void *) false; */ icv_addr[2] = (void *) UINT_MAX; break; case GOMP_ICV_NTHREADS: