From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 53F9F3857017; Mon, 12 Sep 2022 11:33:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53F9F3857017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662982411; bh=2Hh4cy5ilqu5UnFYE2LDbqbzKuxZx+UuFcKMqCP12EY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cs0TyouzmAGbjUbev/4TMMHJ7EPN2hzdxmsEBACIWF/gZ2d6Gganvpv4Lc27tr4tA /gr1j23QvxMEd7oQNugAmQkqWG89vswXKTY2Zo/25huO3btrmH/k6VUKrkl5kQtteR tJ1pJtLEYHbefCJYycN4IEOTY8Q0eXv6izk1bhN8= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/106906] libgomp/env.c: 3 * boolean value assigned to pointer Date: Mon, 12 Sep 2022 11:33:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106906 --- Comment #1 from Jakub Jelinek --- Well, it is correct as is, because while icv_addr[3] and params[3] have voi= d * type, they are actually cast to various types (either other pointers or bool etc.). But there is no need not to make the cast explicit and after all, there is icv_addr[0] =3D icv_addr[1] =3D icv_addr[2] =3D NULL; before the switch, so zero reinitialization is just a waste of time unless compiler optimizes that out. So we could go for: 2022-09-12 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. --- 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] =3D &icvs->nteams_var; - icv_addr[1] =3D false; + /* icv_addr[1] =3D (void *) false; */ break; case GOMP_ICV_DYNAMIC: icv_addr[0] =3D &(*icvs).dyn_var; break; case GOMP_ICV_TEAMS_THREAD_LIMIT: icv_addr[0] =3D &icvs->teams_thread_limit_var; - icv_addr[1] =3D false; + /* icv_addr[1] =3D (void *) false; */ break; case GOMP_ICV_SCHEDULE: icv_addr[0] =3D &icvs->run_sched_var; @@ -1907,7 +1907,7 @@ get_icv_member_addr (struct gomp_initial break; case GOMP_ICV_THREAD_LIMIT: icv_addr[0] =3D &icvs->thread_limit_var; - icv_addr[1] =3D false; + /* icv_addr[1] =3D (void *) false; */ icv_addr[2] =3D (void *) UINT_MAX; break; case GOMP_ICV_NTHREADS:=