public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114451] New: regression : ICE on switch over enum class
@ 2024-03-24 22:47 Alexandre.BUSTICO at enac dot fr
  2024-03-24 22:55 ` [Bug c++/114451] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre.BUSTICO at enac dot fr @ 2024-03-24 22:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

* [Bug c++/114451] regression : ICE on switch over enum class
  2024-03-24 22:47 [Bug c++/114451] New: regression : ICE on switch over enum class Alexandre.BUSTICO at enac dot fr
@ 2024-03-24 22:55 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-24 22:55 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>12.2, 13.1 and 13.2 does not trigger the bug.
Actually those do trigger the bug, just the trunk (in this case GCC 14),
enables checking by default so you end up with an ICE there. If you use
`-fchecking` for the released GCC, you get the ICE too. And if you use
-fno-checking for the trunk, you don't get an ICE.

So this is still a dup.

*** This bug has been marked as a duplicate of bug 103825 ***

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

end of thread, other threads:[~2024-03-24 22:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-24 22:47 [Bug c++/114451] New: regression : ICE on switch over enum class Alexandre.BUSTICO at enac dot fr
2024-03-24 22:55 ` [Bug c++/114451] " pinskia 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).