From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D9B13854172; Mon, 3 Oct 2022 10:59:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D9B13854172 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664794751; bh=eUavaT4QGjfOKYykzoVCtrONFr2qx3FJwl4RwuCZpaU=; h=From:To:Subject:Date:From; b=mSiTw9LClHicO6jWHdSGl9g8JLMNMR9tHOJPVOOqXLC7ZxuVMdPXyt5hf/LtFDqao 8N6OrrCbl61EwWcDJw40wq8JzcN4uGzFpqhP3PToafkXDd/opGL2ZhcJ4G4G3ujozK GEgRDKBehwegvSurbRmJ00G7tsSncO34gGDoa7+E= From: "daniel at constexpr dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107129] New: [13 Regression] False positive -Wstringop-overflow warning with -O2 or -O3 Date: Mon, 03 Oct 2022 10:59:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel at constexpr dot 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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=3D107129 Bug ID: 107129 Summary: [13 Regression] False positive -Wstringop-overflow warning with -O2 or -O3 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: daniel at constexpr dot org Target Milestone: --- Created attachment 53652 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53652&action=3Dedit Reduced testcase The attached testcase produces the following warning with GCC 13.0.0 202210= 02 (commit 3290dcf): $ /opt/gcc-dev/bin/c++ -O2 -c test.cpp=20 test.cpp: In member function =E2=80=98void C::f()=E2=80=99: test.cpp:39:33: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=3D] 39 | c[i] =3D e(1.f - i, i); | ~^~~~~~~~~~~~ test.cpp:9:23: note: at offset 1 into destination object =E2=80=98C4::r=E2= =80=99 of size 1 9 | unsigned char r; |=