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

            Bug ID: 114451
           Summary: regression : ICE on switch over enum class
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Alexandre.BUSTICO at enac dot fr
  Target Milestone: ---

Same bug had been reported as BugID 103825 for gcc12.0.0 The bug has been fixed
for subsequent gcc version : 12.2, 13.1 and 13.2 does not trigger the bug. The
bug is exhibited again with gcc14.0.0 devel.

code that trigger ICE : 

enum class En {A};
struct St {En field :1;};

int main(void)
{
    volatile St s = {.field = En::A};
    switch(s.field) {
        case En::A : break;
    }
}


error message :
<source>: In function 'int main()':
<source>:4:5: error: type precision mismatch in switch statement
    4 | int main(void)
      |     ^~~~
switch (retval.0) <default: <D.6394>, case 0: <D.6388>>
<source>:4:5: internal compiler error: 'verify_gimple' failed
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

gotbolt link : https://compiler-explorer.com/z/Eh39WKvxo
  • [Bug c++/114451] New: regres... Alexandre.BUSTICO at enac dot fr via Gcc-bugs

Reply via email to