From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 30A313858D20; Thu, 9 Mar 2023 20:48:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30A313858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678394881; bh=CJYuxvPFo/dle/lbEe/0uCOcxBlKWN+tBS0wjbU2T74=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QoKV+Th53D/R/vKUk0Sz7pmXEhpTovwyGO8ndMePnXH2jm9J66/EXEItzgzqlMjd4 HGZfHUoIimKNd0MafQ9LmF0Z6mbLGSuvfQu9dbk03QbVy33SYihJEV1mhn/7yiX4go AeniKQlzyqM5DVREPm+59cxvi5zDw3UMONkwA7Xw= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107087] bits/stl_algobase.h:431: warning: 'void* __builtin_memcpy(void*, const void*, unsigned int)' reading between 8 and 2147483644 bytes from a region of size 4 [-Wstringop-overread] Date: Thu, 09 Mar 2023 20:48:00 +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.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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: attachments.created 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=3D107087 --- Comment #1 from Jonathan Wakely --- Created attachment 54628 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54628&action=3Dedit Gzipped preprocessed output Similar errors for this code with -std=3Dc++20 -O2: #include =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 void test01() { std::vector v1, v2{5, 6}; int n =3D 0; std::vector::iterator it =3D v1.insert(v1.cbegin(), n); it =3D v1.insert(v1.cbegin(), 1); it =3D v1.insert(v1.cbegin(), {2, 3}); it =3D v1.insert(v1.cbegin(), 1, 4); it =3D v1.insert(v1.cbegin(), v2.begin(), v2.end()); }=