public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/100980] New: [GCOV]The assignment statement in the “for” structure caused the wrong coverage
@ 2021-06-09 3:10 njuwy at smail dot nju.edu.cn
2021-06-10 14:50 ` [Bug gcov-profile/100980] " marxin at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2021-06-09 3:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100980
Bug ID: 100980
Summary: [GCOV]The assignment statement in the “for” structure
caused the wrong coverage
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=gcc
COLLECT_LTO_WRAPPER=/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=release -enable-languages=c,c++
-disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)
$ cat test.c
#include<stdio.h>
extern void abort(void);
extern void exit(int);
int main(void) {
struct foo{
int i0;
};
int b,c,d=1;
for ((b = sizeof(struct foo {
int i0;
int i1;
}));
d; d--)
c = sizeof(struct foo);
}
$ gcc -O0 --coverage test.c;./a.out;gcov test;cat test.c.gcov
File 'test.c'
Lines executed:100.00% of 5
Creating 'test.c.gcov'
-: 0:Source:test.c
-: 0:Graph:test.gcno
-: 0:Data:test.gcda
-: 0:Runs:1
-: 1:#include<stdio.h>
-: 2:extern void abort(void);
-: 3:extern void exit(int);
1: 4:int main(void) {
-: 5: struct foo{
-: 6: int i0;
-: 7:};
1: 8: int b,c,d=1;
2: 9: for ((b = sizeof(struct foo {
-: 10: int i0;
-: 11: int i1;
-: 12: }));
1: 13: d; d--)
1: 14:c = sizeof(struct foo);
-: 15:}
line 9 was wrongly marked as executed 2 times
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/100980] [GCOV]The assignment statement in the “for” structure caused the wrong coverage
2021-06-09 3:10 [Bug gcov-profile/100980] New: [GCOV]The assignment statement in the “for” structure caused the wrong coverage njuwy at smail dot nju.edu.cn
@ 2021-06-10 14:50 ` marxin at gcc dot gnu.org
2022-06-14 12:46 ` njuwy at smail dot nju.edu.cn
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-10 14:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100980
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2021-06-10
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/100980] [GCOV]The assignment statement in the “for” structure caused the wrong coverage
2021-06-09 3:10 [Bug gcov-profile/100980] New: [GCOV]The assignment statement in the “for” structure caused the wrong coverage njuwy at smail dot nju.edu.cn
2021-06-10 14:50 ` [Bug gcov-profile/100980] " marxin at gcc dot gnu.org
@ 2022-06-14 12:46 ` njuwy at smail dot nju.edu.cn
2022-06-14 15:46 ` njuwy at smail dot nju.edu.cn
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2022-06-14 12:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100980
Yang Wang <njuwy at smail dot nju.edu.cn> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Yang Wang <njuwy at smail dot nju.edu.cn> ---
fixed in later version
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/100980] [GCOV]The assignment statement in the “for” structure caused the wrong coverage
2021-06-09 3:10 [Bug gcov-profile/100980] New: [GCOV]The assignment statement in the “for” structure caused the wrong coverage njuwy at smail dot nju.edu.cn
2021-06-10 14:50 ` [Bug gcov-profile/100980] " marxin at gcc dot gnu.org
2022-06-14 12:46 ` njuwy at smail dot nju.edu.cn
@ 2022-06-14 15:46 ` njuwy at smail dot nju.edu.cn
2022-07-04 12:16 ` njuwy at smail dot nju.edu.cn
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2022-06-14 15:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100980
Yang Wang <njuwy at smail dot nju.edu.cn> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|FIXED |---
Status|RESOLVED |NEW
--- Comment #3 from Yang Wang <njuwy at smail dot nju.edu.cn> ---
The coverage is correct later version (gcov 11.1.0 and 12.1.0),is it fixed?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/100980] [GCOV]The assignment statement in the “for” structure caused the wrong coverage
2021-06-09 3:10 [Bug gcov-profile/100980] New: [GCOV]The assignment statement in the “for” structure caused the wrong coverage njuwy at smail dot nju.edu.cn
` (2 preceding siblings ...)
2022-06-14 15:46 ` njuwy at smail dot nju.edu.cn
@ 2022-07-04 12:16 ` njuwy at smail dot nju.edu.cn
2022-07-04 12:23 ` marxin at gcc dot gnu.org
2022-07-04 12:23 ` marxin at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2022-07-04 12:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100980
--- Comment #4 from Yang Wang <njuwy at smail dot nju.edu.cn> ---
(In reply to Yang Wang from comment #3)
> The coverage is correct later version (gcov 11.1.0 and 12.1.0),is it fixed?
In version 12.1.0
-: 1:#include<stdio.h>
-: 2:extern void abort(void);
-: 3:extern void exit(int);
1: 4:int main(void) {
-: 5: struct foo{
-: 6: int i0;
-: 7:};
1: 8: int b,c,d=1;
1: 9: for ((b = sizeof(struct foo {
-: 10: int i0;
-: 11: int i1;
-: 12: }));
2: 13: d; d--)
1: 14:c = sizeof(struct foo);
-: 15:}
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/100980] [GCOV]The assignment statement in the “for” structure caused the wrong coverage
2021-06-09 3:10 [Bug gcov-profile/100980] New: [GCOV]The assignment statement in the “for” structure caused the wrong coverage njuwy at smail dot nju.edu.cn
` (3 preceding siblings ...)
2022-07-04 12:16 ` njuwy at smail dot nju.edu.cn
@ 2022-07-04 12:23 ` marxin at gcc dot gnu.org
2022-07-04 12:23 ` marxin at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-04 12:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100980
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed with r11-3302-g3696a50beeb73f4d.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/100980] [GCOV]The assignment statement in the “for” structure caused the wrong coverage
2021-06-09 3:10 [Bug gcov-profile/100980] New: [GCOV]The assignment statement in the “for” structure caused the wrong coverage njuwy at smail dot nju.edu.cn
` (4 preceding siblings ...)
2022-07-04 12:23 ` marxin at gcc dot gnu.org
@ 2022-07-04 12:23 ` marxin at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-04 12:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100980
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Thus closing.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-07-04 12:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 3:10 [Bug gcov-profile/100980] New: [GCOV]The assignment statement in the “for” structure caused the wrong coverage njuwy at smail dot nju.edu.cn
2021-06-10 14:50 ` [Bug gcov-profile/100980] " marxin at gcc dot gnu.org
2022-06-14 12:46 ` njuwy at smail dot nju.edu.cn
2022-06-14 15:46 ` njuwy at smail dot nju.edu.cn
2022-07-04 12:16 ` njuwy at smail dot nju.edu.cn
2022-07-04 12:23 ` marxin at gcc dot gnu.org
2022-07-04 12:23 ` 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).