From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D20D1385843A; Mon, 27 Mar 2023 15:38:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D20D1385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679931513; bh=IG9ha9/UBgC/NDX8LNKXzH1Wl5Y0RzD8K/QdpldTwmY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dbQK4hqFP0uxvCwnsM9IjgOGxLQwEmbI7rrgsBmjsW653NlXC15YjaDAN4KXOuuRh GVTdaP9hmXD9JtLbABv+f/6XELsrqpRBvcxTSmfOr/780DERm4euBv3NnnlvzVfH44 FlhkZr76shI7/z/eqsJKWgxgvCaQdllBznmlHtx8= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109299] wrong warning on std::wstring with -O2 -std=c++20 -D_FORTIFY_SOURCE=2 Date: Mon, 27 Mar 2023 15:38:33 +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: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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=3D109299 Xi Ruoyao changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xry111 at gcc dot gnu.org --- Comment #1 from Xi Ruoyao --- You are reducing it wrong. The reduced example should indeed trigger the warning, as it's copying 5 wchar's into a buffer with length 4.=