From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4C8913858C62; Wed, 1 Mar 2023 15:55:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C8913858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677686138; bh=rH72E+HJ+HIJp9WPcenLiw/HZ6KSF04VUYvA3z3JpVs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nVt+OX1JujmgnDlgwFrLIehOxh1Y7pk+Vra2zJk9cBnvG+L0TcFhfYphRWRvJXhN2 7/LRreDVQBsuEOgufyvxoTEJj1ZzJ87WMngCWjOVE8Ag0MIq2RB9XVjeyJImBqx4iq cPt47Uqu9OaLos3Pqpi8rPMI1/0RdntFDrG8yhy0= From: "redi 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: Wed, 01 Mar 2023 15:55:37 +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: redi 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 #20 from Jonathan Wakely --- (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 *t= his > > (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 constructed = yet > at that point? 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 under construction if the object is in an unspecified state. And frankly, if anyb= ody did write an operator new like that, they deserve what they get. Could we have a flag that says "assume operator new is not stupid"?=