[Bug c++/107622] Missing optimization of switch-statement

2023-04-16 Thread klaus.doldinger64 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 --- Comment #12 from Wilhelm M --- (In reply to Wilhelm M from comment #11) > Without an underlying type but with -fshort-enums the underlying type should > be as small as possible. In this case this should be a uint8_t. But in this > case we ge

[Bug c++/107622] Missing optimization of switch-statement

2023-04-16 Thread klaus.doldinger64 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 --- Comment #11 from Wilhelm M --- Without an underlying type but with -fshort-enums the underlying type should be as small as possible. In this case this should be a uint8_t. But in this case we get a 16-bit value for mState. This is a clear vi

[Bug c++/107622] Missing optimization of switch-statement

2022-12-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1

[Bug c++/107622] Missing optimization of switch-statement

2022-12-02 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 Martin Liška changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|marxin at gcc dot

[Bug c++/107622] Missing optimization of switch-statement

2022-11-21 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 Martin Liška changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org Ev

[Bug c++/107622] Missing optimization of switch-statement

2022-11-11 Thread glisse at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 --- Comment #7 from Marc Glisse --- (Wilhelm, when you post testcases, please post the full file including the #include lines) (In reply to Richard Biener from comment #5) > Did you try -fstrict-enums? IIUC, even if optimizations using -fstric

[Bug c++/107622] Missing optimization of switch-statement

2022-11-11 Thread klaus.doldinger64 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 --- Comment #6 from Wilhelm M --- (In reply to Richard Biener from comment #5) > Did you try -fstrict-enums? Yes, that doesn't change anything.

[Bug c++/107622] Missing optimization of switch-statement

2022-11-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 Richard Biener changed: What|Removed |Added Keywords||missed-optimization --- Comment #5 fro

[Bug c++/107622] Missing optimization of switch-statement

2022-11-10 Thread klaus.doldinger64 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 --- Comment #4 from Wilhelm M --- In the following class the static data member is accessible via explicit template instantiation from the outside. So the compiler cannot reason that the value is in [0,2]. But this does not hold for the function

[Bug c++/107622] Missing optimization of switch-statement

2022-11-10 Thread klaus.doldinger64 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 --- Comment #3 from Wilhelm M --- (In reply to Andrew Pinski from comment #1) > > In the following example the default-case > > Yes it can. You can pass a 0xf to that function and still have well defined > behavior. Oh yes, thank you for the

[Bug c++/107622] Missing optimization of switch-statement

2022-11-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 --- Comment #2 from Andrew Pinski --- There is one part which GCC could optimize better that is the store. There might be another bug about that too. Note as I mentioned __builtin_unreachable is needed if truely the value coming inside g is out

[Bug c++/107622] Missing optimization of switch-statement

2022-11-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107622 --- Comment #1 from Andrew Pinski --- > In the following example the default-case Yes it can. You can pass a 0xf to that function and still have well defined behavior.