From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF6953858D33; Mon, 23 Jan 2023 18:18:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF6953858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674497895; bh=omhtCZLAp7PhIJO0gmOl570zpfzinOVDwFcfQFne7AU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vY+qiiIXxk/Ry6MPJ3Y7nZsp4MbZTgTpKzqUNlc1p+H5PpULTvFENc7c+ST7YZLby OD7z0/ohEjG9Arx8pLyLmKmUcBhv7sB95tr53rXQq+Rs1cztzhiDmgNbp+MNAcanUs lmWz/RQsIa0TLv4totHo4iKyIQXZKpAOI1hN+vYw= From: "kungfujesus06 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108498] ppc64 big endian generates uninitialized reads with -fstore-merging Date: Mon, 23 Jan 2023 18:18:15 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: kungfujesus06 at gmail dot com X-Bugzilla-Status: NEW 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: 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=3D108498 --- Comment #15 from Adam Stylinski --- (In reply to Adam Stylinski from comment #14) > (In reply to Andrew Pinski from comment #13) > > Ok, this seems wrong: > >=20 > > New sequence of 1 stores to replace old one of 10 stores > > # .MEM_102 =3D VDEF <.MEM_101> > > MEM [(void *)&insn] =3D "\x02\x00\xff\x03\x00\x01\x02\x03"; > > Exceeded original number of stmts (2). Not profitable to emit new sequ= ence. > >=20 > >=20 > > The size should be 9 rather 8 ... >=20 > Ah cool. I guess the suboptimality is probably a bug in its own right. = Any > reason it's using so many stores to memory? The clang version can > accomplish it almost entirely in GPRs. I guess "entirely in GPRs" isn't very true. Clang does it in 7 stores, with the last being the return value on the stack. GCC is doing it in 16 stores= and quite a few loads. The stack churn is a bit unnerving, is there anything t= hat can be done to improve this?=