From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E50713858437; Mon, 6 Dec 2021 16:45:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E50713858437 From: "roystgnr at ices dot utexas.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100366] [11/12 Regression] spurious warning - std::vector::clear followed by std::vector::insert(vec.end(), ...) with -O2 Date: Mon, 06 Dec 2021 16:45:16 +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.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: roystgnr at ices dot utexas.edu 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: cc 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, 06 Dec 2021 16:45:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100366 Roy Stogner changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |roystgnr at ices dot utexa= s.edu --- Comment #11 from Roy Stogner --- This can even be triggered via std::vector::operator=3D, at least in gcc 11= .2. My own code is slightly more involved than this, but I can boil it down to: std::vector src(2,1), dest(2); dest =3D src; and that's enough to trigger this warning in a -O2 -Wall -Werror build. Oddly, if I write dest(2,0) rather than dest(2), I don't see any warning.=20 That's a fine workaround for my own non-performance-critical code path, but= I wonder if it also indicates that the underlying optimization is no longer b= eing enabled here for code that would benefit.=