From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB0C9384F480; Sat, 26 Nov 2022 15:53:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB0C9384F480 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669477995; bh=RGwmNlo7Ha54KviS6+MCpGlxEhdtdLyp09MIlN3UKik=; h=From:To:Subject:Date:In-Reply-To:References:From; b=o7jyRQOx2WiXjhA2xKjJ23CbBpMvec5uZ4IpfsmPzgMQGsba9pV8L2tlHt5LW6HXQ 2HBIeIJSVmS7phAlVPRJ9c8j9KCilyZ8r5vNKv1Y17sH2KtmeOx5EsuBP9ZbKd/ifr EFpOYzZH7OTCpsvoEMA9HEOGoNUuuee8WDzb119w= From: "zeranoe at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100366] [11/12/13 Regression] spurious warning - std::vector::clear followed by std::vector::insert(vec.end(), ...) with -O2 Date: Sat, 26 Nov 2022 15:53:12 +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, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: zeranoe at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100366 Kyle Schwarz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zeranoe at gmail dot com --- Comment #14 from Kyle Schwarz --- I also ran into this with: > auto data =3D std::make_shared>(); > data->insert(data->end(), {0xAA, 0xBB, 0xCC}); I do not hit it with: > std::vector data; > data.insert(data.end(), {0xAA, 0xBB, 0xCC}); Bisecting shows it was introduced with 81d6cdd335ffc60c216a020d5c99306f659377a2. In gcc/gimple-ssa-warn-access.cc pass_waccess::check() there's now a call to the new pass_waccess::check_builtin() which throws this warning (BUILT_IN_MEMMOVE, check_memop_access()). The old behavior had these checks scattered througho= ut builtins.c but now with it being part of pass_waccess::check() it is called= for each bb as part of pass_waccess::execute().=