From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A32673858C62; Mon, 30 Jan 2023 07:05:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A32673858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675062331; bh=6Lo2aGtpzh6aCCG1kgT4bz2tndUvC81/DEQc+EA4EC0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AcEW4AZIqMx2rCg9gO38TH7geaOlj+J/V6vxIniKi4LJ9riDVKFGtXa0l95grve+1 3ZDmzldf0kWNxAEkvL0/60u4eYWPYgXEkWnjLaAZvw2EmqfhR53Ft1dEC/oto6MWnC NRpOaZ4e9zZOMR/O3pmrHEbDWkQEbPNwQeCbQe5w= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108552] Linux i386 kernel 5.14 memory corruption for pre_compound_page() when gcov is enabled Date: Mon, 30 Jan 2023 07:05:28 +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: 11.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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=3D108552 --- Comment #41 from Richard Biener --- (In reply to Linus Torvalds from comment #31) > (In reply to Richard Biener from comment #26) > >=20 > > Now, in principle we should have applied store-motion and not only PRE = which > > would have avoided the issue, not tricking the RA into reloading the va= lue > > from where we store it in the loop, but the kernel uses -fno-tree-loop-= im, > > preventing that. If you enable that you'd get >=20 > Note that we use -fno-tree-loop-im only for the GCOV case, and because of > another problem with code generation with gcov. See >=20 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69702 >=20 > and the fix for the excessive stack use was to disable that compiler opti= on. > See >=20 >=20=20 > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/ > ?id=3Dc87bf431448b404a6ef5fbabd74c0e3e42157a7f >=20 > for the kernel commit message. Yes, I remember. So another option would be to add -fno-tree-pre to that mix which should avoid hoisting the load out of the loop.=