From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 94B70385781D; Tue, 25 May 2021 12:14:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94B70385781D From: "gejoed at rediffmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/100751] __gcov_dump and __gcov_reset usage Date: Tue, 25 May 2021 12:14:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: 8.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gejoed at rediffmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2021 12:14:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100751 --- Comment #5 from Gejoe --- Running the program: ./a.out=20 g When g is passed, return value is 8 When=20 is passed, return value is 0 r When r is passed, return value is 8 When=20 is passed, return value is 0 << the program is still running, waiting for next character entry>> Now if we see the sample-prog.c.gcov file , it shows : -: 16: do { -: 17:=20=20=20 4: 18: c =3D getchar(); 4: 19: result =3D isalnum(c); 4: 20: printf("When %c is passed, return value is %d\n", c, result); -: 21:=20 4: 22: if(c =3D=3D 'g') 2: 23: __gcov_dump(); 2: 24: else if(c =3D=3D 'r') #####: 25: __gcov_reset(); -: 26:=20=20=20=20 3: 27: }while(c !=3D 'c'); Looking at line 25, it doesn't show the line is hit (by giving 'r' character during a.out run) nor are the counter values reset for the other lines. The count of 4,3,2 are seen for some lines because of a previous a.out run.=