From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 122623858288; Fri, 27 Jan 2023 14:14:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 122623858288 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674828896; bh=HNw7+Cg70f+AUkfnR02QDZzz6naECTrMDgIsEcWN9gU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vK7u6s40MKPwl4GF6tPswQQSkC6bl7vT3GSJpLQvgjnZsreQuPfYPwqo3RQLQAwFf o9oe0uhvlfb1IQk4oo4br9rPavz4eaK9yaVkBurZtWO7wTF5Gksh3PMJLkOjz5xjQQ zC8Cb3AMg8vPWK6ncGy04O1yrfgeUG532oPRPujY= From: "jakub 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: Fri, 27 Jan 2023 14:14:55 +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: jakub 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 #23 from Jakub Jelinek --- We could mark the __gcov* artificial vars with some flag (unless they are already) and try to avoid using IVs loaded from those in IVOPTs, but as can= be seen above, the chosen IV really isn't that memory but an SSA_NAME that is initialized with something loaded from that and in other cases it could be = even not that simple (say multiple copies of the same loop in sequence with a lo= ad from __gcov* only at the beginning and then the loops just using a PRE IV temporary for all the stores). I bet the RA does it from similar reasons, = var isn't volatile, updated many times without any atomic barriers in between, = so if some other thread modifies it in between, it would be a data race.=