public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin 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:20:33 +0000	[thread overview]
Message-ID: <bug-108658-4-pwURA0GLQC@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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-02-06
     Ever confirmed|0                           |1

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Well, with -O2 it's dead-code elimination pass that removes the GCOV counter
stores:

void * idle (void * ignored)
{
  long int __gcov0.idle_I_lsm.4;
  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),
PROF_edge_counter_2(4)>
  PROF_edge_counter_2 = __gcov0.idle_I_lsm.4_6 + 1;

  <bb 4> [local count: 1073741824]:
  goto <bb 3>; [100.00%]

}

after:

Eliminating unnecessary statements:
Deleting : PROF_edge_counter_2 = __gcov0.idle_I_lsm.4_6 + 1;

Deleting : __gcov0.idle_I_lsm.4_6 = PHI <__gcov0.idle_I_lsm.4_7(2), _2(4)>

Deleting : __gcov0.idle_I_lsm.4_7 = __gcov0.idle[0];

Removed 2 of 2 statements (100%)
Removed 1 of 2 PHI nodes (50%)
Merging blocks 3 and 4
fix_loop_structure: fixing up loops for function
void * idle (void * ignored)
{
  long int __gcov0.idle_I_lsm.4;

  <bb 2> [local count: 10631108]:

  <bb 3> [local count: 1073741824]:
  goto <bb 3>; [100.00%]

}

@Richi: is it expected behavior?

  parent reply	other threads:[~2023-02-06  9:20 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 [this message]
2023-02-06  9:56 ` rguenth at gcc dot gnu.org
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-pwURA0GLQC@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: link
Be 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).