public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103825] New: [12 Regression] ICE on switch on enum class in bitfield
@ 2021-12-25  0:26 blubban at gmail dot com
  2021-12-25  0:56 ` [Bug c++/103825] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: blubban at gmail dot com @ 2021-12-25  0:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103825
           Summary: [12 Regression] ICE on switch on enum class in
                    bitfield
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: blubban at gmail dot com
  Target Milestone: ---

enum class Type { Pawn };
struct Piece {
  Type type : 4;
};
void foo() {
  switch (Piece().type)
    case Type::Pawn:;
}


The above causes an ICE on GCC 12.0.0 20211222, no compile flags needed. It
compiles without warnings on GCC 11, Clang, and MSVC.

Compiler Explorer: https://godbolt.org/z/GdG6ovEzz


<source>: In function 'void foo()':
<source>:5:6: error: type precision mismatch in switch statement
    5 | void foo() {
      |      ^~~
switch (retval.0) <default: <D.2160>, case 0: <D.2157>>
<source>:5:6: internal compiler error: 'verify_gimple' failed
0x2115089 internal_error(char const*, ...)
        ???:0
0x11603ed verify_gimple_in_seq(gimple*)
        ???:0
0xdda0d1 gimplify_body(tree_node*, bool)
        ???:0
0xdda397 gimplify_function_tree(tree_node*)
        ???:0
0xbe6a57 cgraph_node::analyze()
        ???:0
0xbeaf6d symbol_table::finalize_compilation_unit()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-02 18:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-25  0:26 [Bug c++/103825] New: [12 Regression] ICE on switch on enum class in bitfield blubban at gmail dot com
2021-12-25  0:56 ` [Bug c++/103825] " pinskia at gcc dot gnu.org
2024-03-24 22:55 ` pinskia at gcc dot gnu.org
2024-03-26 15:48 ` mpolacek at gcc dot gnu.org
2024-04-02 18:19 ` cvs-commit at gcc dot gnu.org
2024-04-02 18:26 ` cvs-commit at gcc dot gnu.org
2024-04-02 18:27 ` mpolacek at gcc dot gnu.org

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).