From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 12CF33858C66; Thu, 13 Apr 2023 13:18:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12CF33858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681391927; bh=fmSG4CFleOcEkLVnFENA2WnRaf9HVPRz2Jd452Uuzzk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PkwJO6AJoBdDyxVLXFzkCL6mOoOytPNtdWoCb+f+kWg7UxzOfEhIEQW+/b6F+N0qC lyjGGAC8ixMa9aqFYgHKi27tSSuELLLXS3eaI3AGNo70BhVy1ALKfctLwpng84z55W bYvV6VFjdkyCe9AAa8ECgwVAwvC6wisZRhKiJF9E= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109443] missed optimization of std::vector access (Related to issue 35269) Date: Thu, 13 Apr 2023 13:18:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: alias, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 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=3D109443 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |redi at gcc dot gnu.org --- Comment #15 from Jakub Jelinek --- (In reply to rguenther@suse.de from comment #14) > If that's valid then all bets for this PR are off since f() then > _can_ change v.size (). Well, in C++ the ctors are typically defined inline, so if we wanted and th= ey would be inline the FE could do some quick check whether the ctor could leak the this address or some address derived from it and we could do the optimization only if we prove that the copy constructor (and default constructor?) doesn't do this. CCing Jonathan on whether it is valid.=