From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DF09E3853826; Mon, 7 Jun 2021 11:55:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF09E3853826 From: "george.thopas at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/100920] bogus warnings with -Wscalar-storage-order Date: Mon, 07 Jun 2021 11:55:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: george.thopas at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ebotcazou at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 11:55:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100920 --- Comment #6 from George Thopas --- (In reply to Eric Botcazou from comment #5) > Thanks for reporting the problem. Thanks for the swift fix. It nicely resolves it for the malloc/alloca ...=20 It doesn't seem to do anything for the rest of the common idioms however when I extend the testcase. int main() { t_s12 *msg1 =3D __builtin_alloca(10); t_u12 *msg2 =3D __builtin_alloca(10); int same; msg1 =3D malloc (sizeof (t_s12)); msg2 =3D malloc (sizeof (t_u12)); memset(msg1, 0, sizeof(t_s12)); memcpy(msg2, &msg1, sizeof(t_s12)); same =3D memcmp(msg2, msg1, sizeof(t_s12)); free(msg1); return same; }=