From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9C7973858D20; Wed, 31 May 2023 22:53:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C7973858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685573622; bh=wwmvrV8GXg87Nf5tbNkqm5045m3m28A3OsS1lmVVX+Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kEP3IehpIdll4DpIUWkbnSXtwVcd6pg6ANQtyQQQBMkqd5Np1m9tqiz/wLurWUHPU VyWRhASYPYn43IgLlSYABpYYqH89Ks7Wiqj8c/1CeNmmj3V2hCsxqf0hifEHhogOmD l2fUZ/bHyPD1qGjNoIFYLELZKjRqWHvQSIg1rewk= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110060] Adding optimizer hints to std::vector causes a new -Wstringop-overread false positive Date: Wed, 31 May 2023 22:53:42 +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: 14.0 X-Bugzilla-Keywords: diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: keywords 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=3D110060 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization --- Comment #1 from Andrew Pinski --- Hmm: ``` MEM[(struct _Vector_base *)&w]._M_impl.D.25239._M_start =3D _73; _66 =3D _73 + 1; MEM[(struct _Vector_base *)&w]._M_impl.D.25239._M_end_of_storage =3D _66; MEM[(struct vector *)&w].D.25935._M_impl.D.25239._M_finish =3D _66; _486 =3D _63 + 2; v.D.25935._M_impl.D.25239._M_finish =3D _486; _154 =3D _63 + 3; v.D.25935._M_impl.D.25239._M_finish =3D _154; _138 =3D MEM[(struct X * const &)&v]; _215 =3D v.D.25935._M_impl.D.25239._M_end_of_storage; _216 =3D v.D.25935._M_impl.D.25239._M_finish; if (_215 !=3D _216) ``` There is huge missed optimizations here. I noticed that the last fre is not iterative and we have the case where man= y of the ifs are removed due to fre and forwprop at the end.=