[Bug c++/93674] New: GCC eliminates conditions it should not, when strict-enums is on

2020-02-11 Thread gbuella at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gbuella at gmail dot com Target Milestone: --- $ cat code.cc enum some_enum { x = 1000 }; void sink(some_enum); void func() { for (int i = 0; i < 3; ++i) {

[Bug c++/93674] GCC eliminates conditions it should not, when strict-enums is on

2020-02-11 Thread gbuella at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93674 --- Comment #2 from Gábor Buella --- (In reply to Andrew Pinski from comment #1) > -fstrict-enums > Allow the compiler to optimize using the assumption that a value of > enumerated type can only be one of the values of the enumeration (as defined

[Bug c++/93674] GCC eliminates conditions it should not, when strict-enums is on

2020-02-11 Thread gbuella at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93674 --- Comment #3 from Gábor Buella --- In case anyone would still get confused about the what values get casted to enum, here is another way to write that example: enum some_enum { x0, x1, x2, x3, x4, x5, x6, x7, x8, x9,

[Bug c++/93674] GCC eliminates conditions it should not, when strict-enums is on

2020-02-11 Thread gbuella at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93674 --- Comment #6 from Gábor Buella --- (In reply to Jonathan Wakely from comment #4) > I can't reproduce this with GCC 9, only 8. $ cat code.cc enum some_enum { x = 1000 }; void sink(some_enum); void func() { for (int i = 0; i < 3; ++i)

[Bug c++/88086] gcc only allows valid expressions as unknown C++ attribute argument clause

2020-03-06 Thread gbuella at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88086 Gábor Buella changed: What|Removed |Added CC||gbuella at gmail dot com --- Comment #1