From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 44A863858C33; Fri, 27 Jan 2023 10:47:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 44A863858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674816449; bh=QtlI5xtU+IN6Ovs1EZ04y/w3GbkSNofVyIzhhHTX5vc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ly8sV+gtwyuvo452YQ6ml2v8BLStUv4m0wY+VeSIxX4BAtlC4j7cIjJPxRg1M8k07 C+x1YGEgcukKn9VGq2GjmL/yOhzP0zPRD1kC9xcjyGIUCujEi3sq4bCYl8fIb6nQ0d xA2puDURsoiDbJlxXI5ylPZblxQhVEMJ3tlto0s8= From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108552] Linux i386 kernel 5.14 memory corruption for pre_compound_page() when gcov is enabled Date: Fri, 27 Jan 2023 10:47:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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 #14 from Uro=C5=A1 Bizjak --- The loop is actually pretty simple, please see the interpretation below -24(%ebp): some value previously saved to stack frame %ecx: address to write to %eax/%edx: loop iterator %edi/%esi: termination value .L1469: movl %eax, __gcov0.prep_compound_page+56 movl -24(%ebp), %ebx addl $1, %eax <- increase loop iterator (low word)... movl %edx, __gcov0.prep_compound_page+60 adcl $0, %edx <- ... and high word addl $40, %ecx <- increase address pointer movl $1024, -28(%ecx) <- write to address movl %ebx, -36(%ecx) < movl %edi, %ebx <- loop exit test: %eax/%edx =3D=3D %edi= /%esi xorl %edx, %ebx < movl %ebx, -20(%ebp) < movl %esi, %ebx < xorl %eax, %ebx < orl -20(%ebp), %ebx < jne .L1469 < So, are loop iterator and termination value correct at the beginning of the loop?=