public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/97917] New: [GCOV]incorrect code coverage for intrinsics
@ 2020-11-20 0:30 yangyibiao at outlook dot com
2020-11-20 0:30 ` [Bug gcov-profile/97917] " yangyibiao at outlook dot com
2020-11-20 9:13 ` marxin at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: yangyibiao at outlook dot com @ 2020-11-20 0:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97917
Bug ID: 97917
Summary: [GCOV]incorrect code coverage for intrinsics
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: gcov-profile
Assignee: unassigned at gcc dot gnu.org
Reporter: yangyibiao at outlook dot com
CC: marxin at gcc dot gnu.org
Target Milestone: ---
$ cat test.c
#include <x86intrin.h>
typedef double D __attribute__((may_alias));
__attribute__((aligned(16))) static const double r[4] = { 1., 5., 1., 3. };
__attribute__((noinline, noclone))
void foo (int x) { return; }
int main ()
{
__m128d t = _mm_set1_pd (5.);
((D *)(&t))[0] = 1.;
foo (_mm_movemask_pd (_mm_cmpeq_pd (t, _mm_load_pd (&r[0]))));
return 0;
}
$ gcc -O0 --coverage test.c; ./a.out; gcov test.c; cat test.c.gcov
File 'test.c'
Lines executed:100.00% of 6
Creating 'test.c.gcov'
File '/usr/gcc-trunk/lib/gcc/x86_64-pc-linux-gnu/10.0.1/include/emmintrin.h'
Lines executed:100.00% of 4
Creating 'emmintrin.h.gcov'
-: 0:Source:test.c
-: 0:Graph:test.gcno
-: 0:Data:test.gcda
-: 0:Runs:1
-: 1:#include <x86intrin.h>
-: 2:
-: 3:typedef double D __attribute__((may_alias));
-: 4:__attribute__((aligned(16))) static const double r[4] = { 1.,
5., 1., 3. };
-: 5:
-: 6:__attribute__((noinline, noclone))
1: 7:void foo (int x) { return; }
-: 8:
1: 9:int main ()
-: 10:{
1: 11: __m128d t = _mm_set1_pd (5.);
1: 12: ((D *)(&t))[0] = 1.;
3: 13: foo (_mm_movemask_pd (_mm_cmpeq_pd (t, _mm_load_pd
(&r[0]))));
1: 14: return 0;
-: 15:}
############################
Line #13 is wrongly marked as executed 3 times.
When debug this program in gdb, Line #13 is hit only once.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug gcov-profile/97917] [GCOV]incorrect code coverage for intrinsics
2020-11-20 0:30 [Bug gcov-profile/97917] New: [GCOV]incorrect code coverage for intrinsics yangyibiao at outlook dot com
@ 2020-11-20 0:30 ` yangyibiao at outlook dot com
2020-11-20 9:13 ` marxin at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: yangyibiao at outlook dot com @ 2020-11-20 0:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97917
--- Comment #1 from Yibiao Yang <yangyibiao at outlook dot com> ---
$ gcc --version; gcov --version
gcc (GCC) 10.0.1 20200419 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcov (GCC) 10.0.1 20200419 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug gcov-profile/97917] [GCOV]incorrect code coverage for intrinsics
2020-11-20 0:30 [Bug gcov-profile/97917] New: [GCOV]incorrect code coverage for intrinsics yangyibiao at outlook dot com
2020-11-20 0:30 ` [Bug gcov-profile/97917] " yangyibiao at outlook dot com
@ 2020-11-20 9:13 ` marxin at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-20 9:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97917
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2020-11-20
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed.
Related to fact that we "jump" to another code before moving back to line 13:
__P_18 = [pr97917.c:13:3] &[pr97917.c:13:57] r[0];
[/usr/lib64/gcc/x86_64-suse-linux/10/include/emmintrin.h:124:10] _19 =
MEM[(__m128d * {ref-all})__P_18];
<bb 5> :
<L4>:
_23 = _19;
<bb 6> :
[pr97917.c:13:3] _3 = _23;
[pr97917.c:13:3] t.1_4 = t;
__A_15 = t.1_4;
__B_16 = _3;
[/usr/lib64/gcc/x86_64-suse-linux/10/include/emmintrin.h:358:19] _17 =
__builtin_ia32_cmpeqpd (__A_15, __B_16);
<bb 7> :
<L3>:
_24 = _17;
<bb 8> :
[pr97917.c:13:3] _5 = _24;
__A_13 = _5;
[/usr/lib64/gcc/x86_64-suse-linux/10/include/emmintrin.h:958:10] _14 =
__builtin_ia32_movmskpd (__A_13);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-20 9:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 0:30 [Bug gcov-profile/97917] New: [GCOV]incorrect code coverage for intrinsics yangyibiao at outlook dot com
2020-11-20 0:30 ` [Bug gcov-profile/97917] " yangyibiao at outlook dot com
2020-11-20 9:13 ` marxin at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).