From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6BEE6385802B; Fri, 17 Sep 2021 11:41:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BEE6385802B From: "hv at crypt dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102329] pointer "maybe uninitialized" right after assignment Date: Fri, 17 Sep 2021 11:41:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: hv at crypt dot org X-Bugzilla-Status: NEW 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 11:41:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102329 --- Comment #5 from Hugo van der Sanden --- (In reply to Martin Sebor from comment #4) > For functions like pthread_getspecific() and pthread_setspecific() that do > not access the object GCC provides attribute access none to suppress the > warning: >=20 > extern __attribute__ ((access (none, 1))) void f1 (const void *pointer); Well that's not a solution for developers of perl, since these system heade= rs are not under our control. I'm not sure it's a solution right now for developers of those system headers either, since adding the attribute yield= s a different warning under slightly earlier versions of gcc, eg with gcc-9.2.1: test.c:8:1: warning: 'access' attribute directive ignored [-Wattributes] 8 | extern int pthread_setspecific (unsigned int key, const void *point= er) __attribute__ ((access (none, 2))); | ^~~~~~ I think we still find the original sort of maybe-uninitialized warnings use= ful, so we'll probably just do the useless initialization, and the code will run= a bit slower under gcc.=