public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/101162] New: [12 Regression] ICE (verify_gimple failed) for switch returning pointer-to-members
Date: Tue, 22 Jun 2021 08:40:24 +0000	[thread overview]
Message-ID: <bug-101162-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101162
           Summary: [12 Regression] ICE (verify_gimple failed) for switch
                    returning pointer-to-members
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid testcase triggers an ICE on trunk when compiled with "-O2":

===================================
struct A
{
  int i1, i2, i3, i4, i5, i6;
};

int A::* foo(int i)
{
  switch (i)
  {
    case 1: return &A::i1;
    case 2: return &A::i2;
    case 3: return &A::i3;
    case 4: return &A::i4;
    case 5: return &A::i5;
    case 6: return &A::i6;
  }

  return 0;
}
===================================

bug.cc: In function 'int A::* foo(int)':
bug.cc:19:1: error: invalid types for 'mult_expr'
   19 | }
      | ^
<<< Unknown tree: offset_type >>>
<<< Unknown tree: offset_type >>>
<<< Unknown tree: offset_type >>>
_7 = 4 * _6;
during GIMPLE pass: switchconv
bug.cc:19:1: internal compiler error: verify_gimple failed
0x11025aa verify_gimple_in_cfg(function*, bool)
        ../../gcc/gcc/tree-cfg.c:5531
0xfe1587 execute_function_todo
        ../../gcc/gcc/passes.c:2042
0xfe1fab execute_todo
        ../../gcc/gcc/passes.c:2096
Please submit a full bug report, [etc.]

This regression was introduced between 2021-06-14 and 2021-06-21.

             reply	other threads:[~2021-06-22  8:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  8:40 reichelt at gcc dot gnu.org [this message]
2021-06-22  8:45 ` [Bug c++/101162] " pinskia at gcc dot gnu.org
2021-06-22  8:47 ` [Bug tree-optimization/101162] " pinskia at gcc dot gnu.org
2021-06-22  9:07 ` jakub at gcc dot gnu.org
2021-06-22  9:11 ` [Bug tree-optimization/101162] [12 Regression] ICE (verify_gimple failed) for switch returning pointer-to-members since r12-1608 pinskia at gcc dot gnu.org
2021-06-22  9:12 ` jakub at gcc dot gnu.org
2021-06-22 12:30 ` marxin at gcc dot gnu.org
2021-06-22 13:23 ` cvs-commit at gcc dot gnu.org
2021-07-18 10:41 ` jakub 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-101162-4@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).