From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C94D93858C53; Thu, 2 Mar 2023 07:53:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C94D93858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677743608; bh=R5g+Rp1yvBIecKPcGr/kw18GicX0inTPtTN17F/KQ6M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oKbfDbnyp2DzkCEbAsv5dNj5uUkicavHxy1eJHlm6fRDNe3npqQqAoqvM81lsBBaH tLSUgJ/PGq2e+cyXo2XqXxTxamQrHRq3hPGZYrvLoq1bUXZOuGZIcnmnEgnyPHVEDe qDhWt84VS9qODFgxuNjuCWWBW/Ap3eEFbjAXtqqA= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107561] [13 Regression] g++.dg/pr71488.C and [g++.dg/warn/Warray-bounds-16.C -m32] regression due to -Wstringop-overflow problem Date: Thu, 02 Mar 2023 07:53:28 +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: 13.0 X-Bugzilla-Keywords: diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D107561 --- Comment #22 from Richard Biener --- (In reply to Jonathan Wakely from comment #20) > (In reply to Jakub Jelinek from comment #16) > > (In reply to Richard Biener from comment #15) > > > where if I understand you correctly, bar () is not allowed to modify = *this > > > (unless I pass it an argument to it, of course), even if *this is for > > > example > >=20 > > Why? Because it is a constructor and the object isn't fully constructe= d yet > > at that point? >=20 > Yes, exactly. The object's lifetime has not started until the constructor > completes, so accessing it is only allowed in very limited ways, described > in [basic.life] p6. However, it looks like for a non-trivial constructor = the > results are just unspecified, not undefined, see [class.cdtor] p2. Still,= I > don't see how operator new could meaningfully do anything to an object un= der > construction if the object is in an unspecified state. And frankly, if > anybody did write an operator new like that, they deserve what they get. >=20 > Could we have a flag that says "assume operator new is not stupid"? We certainly could add that and with that revert the effect of not making new/delete "pure" (I'd have to look up the PR we've reverted the change that generally made it so).=