From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 81DE13858CDA; Mon, 30 Jan 2023 08:46:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81DE13858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675068408; bh=TLD/WTivmf5PkWfNxJz64nA941TWgF3iKJoqS7PYRQA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bz+A3dcglwmygS8NmtB5jBbc3+Yg7+UTMo1ItUJLfU+X/vwoy1gKQEfcds02NUhis H1dQ8xYOVGDcTJr6hisZXuNNKDnFENMc9OIylET9Z9fqkZkjps+CL7p95E9waA9U91 FeGpxUt9yKl8QOfogo8A8VaMiWPqPapAvG7E2JDo= From: "rguenther at suse dot de" 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 08:46:47 +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: rguenther at suse dot de 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 #46 from rguenther at suse dot de --- On Mon, 30 Jan 2023, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108552 >=20 > --- Comment #44 from Jakub Jelinek --- > I guess we should try and see. > For volatile, > --- gcc/coverage.cc 2023-01-02 09:32:37.078072992 +0100 > +++ gcc/coverage.cc 2023-01-30 09:24:45.219951352 +0100 > @@ -774,6 +774,7 @@ build_var (tree fn_decl, tree type, int > TREE_STATIC (var) =3D 1; > TREE_ADDRESSABLE (var) =3D 1; > DECL_NONALIASED (var) =3D 1; > + TREE_THIS_VOLATILE (var) =3D 1; > SET_DECL_ALIGN (var, TYPE_ALIGN (type)); >=20 > return var; >=20 > would do it I think (but it should be conditional on new -fupdate-profile > modes, single-volatile and prefer-atomic-volatile or something similar). > Or perhaps insert asm volatile ("" : "+g" (tmp)); in between the load and= store > and see how that compares to the volatile vars? Or adding another flag on= the > gcov vars next to DECL_NONALIASED and just avoid specific optimizations o= n it > that somebody runs into (not as reliable but could be faster) - for now > hoisting in LIM and sinking. We could put an __attribute__(("semi atomic")) on them ... it all somewhat feels like a hack. We could make half of the update volatile only, like only make the store volatile, not the read?=