From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E334F3858409; Sat, 4 Feb 2023 04:42:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E334F3858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675485778; bh=JP53JAbDo0jAlKOyezf0GBHLGVRXlSyjHJ7UR61yO0s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CnS6LDl31lErS4zc0iu1z7qlrSVeE4fPi6Y/taWZo0AJzRm1zE0+Ql9tg9SsrPQIt iarHp+SNvqjuCvaTNgBV2huiuKTZyk69waWY6r5ZifuNL6i1Q+xJZj62A3G6DrJHTI bjNwcU05zE2uh9+3Uht46CZv2YqBFoW/tCkpWZZk= From: "pokechu022+gccbugzilla at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96963] [10 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members Date: Sat, 04 Feb 2023 04:42:57 +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: 10.2.0 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: pokechu022+gccbugzilla at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: msebor at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 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=3D96963 Pokechu22 changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pokechu022+gccbugzilla@gmai | |l.com --- Comment #16 from Pokechu22 --- I ran into this with Dolphin Emulator (see https://github.com/dolphin-emu/dolphin/pull/11534), but ran into trouble tr= ying to simplify it. Here's what I ended up with: ``` struct Foo { char pad[40]; char a, b; }; struct Bar { void Baz(); // One of these needs to be uncommented for the issue to occur // virtual void Qux(); // int x; Foo foo; }; void heh(char *); void Bar::Baz() { heh(&foo.a); foo.a =3D 1; foo.b =3D 1; } ``` Based on Godbolt (https://godbolt.org/z/46aTrP3vj) I can confirm that this doesn't happen in 11.0 or 9.3/9.5, and does happen on 10.1/10.2/10.3/10.4.=