From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B1FF63858C2C; Mon, 27 Sep 2021 21:37:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1FF63858C2C From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102466] -O3 -fsanitize=undefined causes warnings (writing 2 bytes into a region of size 0) Date: Mon, 27 Sep 2021 21:37:30 +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: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed cc cf_reconfirmed_on blocked bug_status 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, 27 Sep 2021 21:37:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102466 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 CC| |msebor at gcc dot gnu.org Last reconfirmed| |2021-09-27 Blocks| |88443 Status|UNCONFIRMED |NEW --- Comment #2 from Martin Sebor --- Confirmed. As Martin indicated in comment #1, the UBSAN sanitization is causing the warning to trigger. The IL the first instance is issued for is below (-fdump-tree-strlen): if (iter_554 =3D=3D 0B) goto ; [0.00%] else goto ; [100.00%] [count: 0]: __builtin___ubsan_handle_nonnull_arg (&*.Lubsan_data478); [local count: 850510933]: if (_560 =3D=3D 0B) goto ; [0.00%] else goto ; [100.00%] [count: 0]: __builtin___ubsan_handle_nonnull_arg (&*.Lubsan_data479); [local count: 850510933]: <<< iter_= 554 is null _565 =3D MEM [(char * {ref-all})_558]; MEM [(char * {ref-all})iter_554] =3D _565; <<< -Wstringop-overflow .UBSAN_PTR (iter_554, 2); The problem is likely a duplicate of one of the existing reports of the same problem. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D88443 [Bug 88443] [meta-bug] bogus/missing -Wstringop-overflow warnings=