From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4C21D385782F; Sun, 7 Mar 2021 08:34:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C21D385782F From: "njuwy at smail dot nju.edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/99443] New: [GCOV] No coverage with "Aborted(core dumped)" Date: Sun, 07 Mar 2021 08:34:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: njuwy at smail dot nju.edu.cn 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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: Sun, 07 Mar 2021 08:34:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99443 Bug ID: 99443 Summary: [GCOV] No coverage with "Aborted(core dumped)" Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: njuwy at smail dot nju.edu.cn CC: marxin at gcc dot gnu.org Target Milestone: --- $ gcc -v Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/local/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto= -wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure -enable-checking=3Drelease -enable-languages= =3Dc,c++ -disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.0 (GCC)=20 $ cat test.c #include #include extern void abort(void); #ifdef __x86_64__ #define EFLAGS_TYPE unsigned long long int #else #define EFLAGS_TYPE unsigned int #endif int main() { printf("1\n"); EFLAGS_TYPE flags =3D 0xD7; /* 111010111b */ __writeeflags(flags); flags =3D __readeflags(); printf("2\n"); if ((flags & 0xFF) !=3D 0xD7) abort(); printf("3\n"); #ifdef DEBUG printf("PASSED\n"); #endif } $ gcc -O0 --coverage test.c;./a.out;gcov test;cat test.c.gcov 1 2 Aborted (core dumped) test.gcda:cannot open data file, assuming not executed File 'test.c' Lines executed:0.00% of 8 Creating 'test.c.gcov' File '/usr/local/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/ia32intrin.h' Lines executed:0.00% of 3 Creating 'ia32intrin.h.gcov' -: 0:Source:test.c -: 0:Graph:test.gcno -: 0:Data:- -: 0:Runs:0 -: 1:#include -: 2:#include -: 3: -: 4:extern void abort(void); -: 5: -: 6:#ifdef __x86_64__ -: 7:#define EFLAGS_TYPE unsigned long long int -: 8:#else -: 9:#define EFLAGS_TYPE unsigned int -: 10:#endif -: 11: #####: 12:int main() { #####: 13: printf("1\n"); #####: 14: EFLAGS_TYPE flags =3D 0xD7; /* 111010111b */ -: 15: __writeeflags(flags); #####: 16: flags =3D __readeflags(); #####: 17: printf("2\n"); #####: 18: if ((flags & 0xFF) !=3D 0xD7) #####: 19: abort(); #####: 20: printf("3\n"); -: 21:#ifdef DEBUG -: 22: printf("PASSED\n"); -: 23:#endif -: 24:} We can see that line #13,#14 were executed,which means that main function executed too. However, no coverage generated.=