public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/97125] [11 Regression] new problem with -Wduplicated-branches
Date: Sun, 20 Sep 2020 19:58:36 +0000	[thread overview]
Message-ID: <bug-97125-4-A76qLJKxTv@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97125-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We crash because now the C FE uses a SWITCH_STMT in the else branch:

2766   /* Compute the hash of the else branch.  */
2767   inchash::hash hstate1 (0);
2768   inchash::add_expr (elseb, hstate1);
2769   hashval_t h1 = hstate1.end ();

but the fold-const.c routines don't know how to handle such a code.  This is
not a problem in the C++ FE because by the time we get to
do_warn_duplicated_branches we've already cp_genericize'd the SWITCH_STMT tree
into a SWITCH_EXPR.

  parent reply	other threads:[~2020-09-20 19:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-20 10:30 [Bug c/97125] New: " dcb314 at hotmail dot com
2020-09-20 10:37 ` [Bug c/97125] " dcb314 at hotmail dot com
2020-09-20 19:06 ` [Bug c/97125] [11 Regression] " mpolacek at gcc dot gnu.org
2020-09-20 19:06 ` mpolacek at gcc dot gnu.org
2020-09-20 19:58 ` mpolacek at gcc dot gnu.org [this message]
2020-09-20 20:07 ` mpolacek at gcc dot gnu.org
2020-09-20 20:29 ` sandra at gcc dot gnu.org
2020-09-20 20:32 ` mpolacek at gcc dot gnu.org
2020-09-20 21:40 ` sandra at gcc dot gnu.org
2020-09-23 14:05 ` mpolacek at gcc dot gnu.org
2020-09-23 14:11 ` cvs-commit at gcc dot gnu.org
2020-09-23 14:12 ` mpolacek 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-97125-4-A76qLJKxTv@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).