From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 962183858410; Mon, 17 Jan 2022 03:49:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 962183858410 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104060] [11/12 Regression] -Wmaybe-uninitialized false alarm on address of local array Date: Mon, 17 Jan 2022 03:49:32 +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.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.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: 11.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status everconfirmed cf_reconfirmed_on cf_known_to_work short_desc cf_known_to_fail keywords target_milestone 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: Mon, 17 Jan 2022 03:49:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104060 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2022-01-17 Known to work| |10.3.0 Summary|-Wmaybe-uninitialized false |[11/12 Regression] |alarm on address of local |-Wmaybe-uninitialized false |array |alarm on address of local | |array Known to fail| |11.1.0 Keywords| |diagnostic Target Milestone|--- |11.3 --- Comment #1 from Andrew Pinski --- Confirmed reduced further: void *ptr_align (void const *ptr, unsigned long alignment); int j (void) { unsigned char j[10000]; unsigned char *k =3D ptr_align (j, 1024); return !k; } The warning is suspect to make sure you have accessed something inside j be= fore the call to ptr_align but it looks like the warning just produces false positive 100% of the time in this testcase and there is no way for the warn= ing to be shut up correctly.. There is no way for GCC to know what ptr_align does, GCC thinks it reads fr= om the first argument but it does not. Note my recommendation to how to fix this is we should just revert this war= ning which was added for GCC 11 and close the original bug which asks about this warning as won't fix.=