public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/108658] [GCOV] Function entry is not recorded in a function containing an infinite loop from another thread depending on the optimization level Date: Mon, 06 Feb 2023 09:56:49 +0000 [thread overview] Message-ID: <bug-108658-4-W47rKwy5Qy@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108658-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108658 --- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- The relevant optimization happens in invariant motion which applies store-motion to void * idle (void * ignored) { long int PROF_edge_counter_1; long int PROF_edge_counter_2; <bb 2> [local count: 10631108]: <bb 3> [local count: 1073741824]: PROF_edge_counter_1 = __gcov0.idle[0]; PROF_edge_counter_2 = PROF_edge_counter_1 + 1; __gcov0.idle[0] = PROF_edge_counter_2; goto <bb 3>; [100.00%] producing void * idle (void * ignored) { long int __gcov0.idle_I_lsm.4; long int PROF_edge_counter_1; long int PROF_edge_counter_2; <bb 2> [local count: 10631108]: __gcov0.idle_I_lsm.4_7 = __gcov0.idle[0]; <bb 3> [local count: 1073741824]: # __gcov0.idle_I_lsm.4_6 = PHI <__gcov0.idle_I_lsm.4_7(2), __gcov0.idle_I_lsm.4_8(4)> PROF_edge_counter_1 = __gcov0.idle_I_lsm.4_6; PROF_edge_counter_2 = PROF_edge_counter_1 + 1; __gcov0.idle_I_lsm.4_8 = PROF_edge_counter_2; <bb 4> [local count: 1073741824]: goto <bb 3>; [100.00%] that's not wrong I think. With -fprofile-update=atomic that doesn't happen but the atomic update call never gets a location assigned, instead we rely on the stmt-begin/end notes here? void * idle (void * ignored) { <bb 2> [local count: 10631108]: <bb 3> [local count: 1073741824]: __atomic_fetch_add_8 (&__gcov0.idle[0], 1, 0); goto <bb 3>; [100.00%]
next prev parent reply other threads:[~2023-02-06 9:56 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-03 15:12 [Bug gcov-profile/108658] New: [GCOV] Function entry is not recorded in a function containing an infinite loop " sebastian.huber@embedded-brains.de 2023-02-03 15:23 ` [Bug gcov-profile/108658] " pinskia at gcc dot gnu.org 2023-02-03 16:36 ` pinskia at gcc dot gnu.org 2023-02-03 17:39 ` [Bug gcov-profile/108658] [GCOV] Function entry is not recorded in a function containing an infinite loop from another thread " sebastian.huber@embedded-brains.de 2023-02-03 18:28 ` sebastian.huber@embedded-brains.de 2023-02-06 9:20 ` marxin at gcc dot gnu.org 2023-02-06 9:56 ` rguenth at gcc dot gnu.org [this message] 2023-02-06 9:57 ` rguenth at gcc dot gnu.org 2023-02-09 10:23 ` marxin at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108658-4-W47rKwy5Qy@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).