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/114715] Gcov allocates branches to wrong row for nested switches
Date: Mon, 15 Apr 2024 09:05:01 +0000	[thread overview]
Message-ID: <bug-114715-4-QpvJDBB0dS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114715-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114715

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index 3df58b962f3..26e96ada4c7 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -3017,6 +3017,7 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p)

       switch_stmt = gimple_build_switch (SWITCH_COND (switch_expr),
                                         default_case, labels);
+      gimple_set_location (switch_stmt, EXPR_LOCATION (switch_expr));
       /* For the benefit of -Wimplicit-fallthrough, if switch_body_seq
         ends with a GIMPLE_LABEL holding SWITCH_BREAK_LABEL_P LABEL_DECL,
         wrap the GIMPLE_SWITCH up to that GIMPLE_LABEL into a GIMPLE_BIND,

fixes the testcase

  parent reply	other threads:[~2024-04-15  9:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  6:38 [Bug gcov-profile/114715] New: " a_aili at hotmail dot com
2024-04-15  8:51 ` [Bug gcov-profile/114715] " rguenth at gcc dot gnu.org
2024-04-15  8:53 ` rguenth at gcc dot gnu.org
2024-04-15  9:05 ` rguenth at gcc dot gnu.org [this message]
2024-04-15  9:11 ` rguenth at gcc dot gnu.org
2024-04-15 11:45 ` rguenth at gcc dot gnu.org
2024-05-03 13:55 ` cvs-commit at gcc dot gnu.org
2024-05-03 14:00 ` rguenth at gcc dot gnu.org
2024-05-16  9:56 ` cvs-commit 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-114715-4-QpvJDBB0dS@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).