[Bug c/99810] Wrong const evaluation of 64-bit division

2021-03-29 Thread gcc at cookiesoft dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99810 --- Comment #5 from gcc at cookiesoft dot de --- Alright. Then again, sorry for the noise. I was hunting down a bug and thought I found it with this one... so I have to search further. Thank you everyone!

[Bug c/99810] Wrong const evaluation of 64-bit division

2021-03-29 Thread gcc at cookiesoft dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99810 --- Comment #3 from gcc at cookiesoft dot de --- I actually haven't, but yes, you're right that it will print out the correct value. I'm somewhat sorry for the noise. Is there a reason, e.g. performance, that the .word is "wrong"?

[Bug c/99810] New: Wrong const evaluation of 64-bit division

2021-03-29 Thread gcc at cookiesoft dot de via Gcc-bugs
Assignee: unassigned at gcc dot gnu.org Reporter: gcc at cookiesoft dot de Target Milestone: --- Host: x86_64 Target: arm The following code produces a different result on arm and x86_64: https://gcc.godbolt.org/z/PPvoscdWa ``` #include #include int

[Bug c++/99362] invalid unused result

2021-03-03 Thread gcc at cookiesoft dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99362 --- Comment #2 from gcc at cookiesoft dot de --- it's not my code, but a MCVE ;) I'm using [tomlplusplus](https://github.com/marzer/tomlplusplus/blob/master/toml.hpp) and there the constructor is marked as nodiscard. I may file an i

[Bug c++/99362] New: invalid unused result

2021-03-03 Thread gcc at cookiesoft dot de via Gcc-bugs
: unassigned at gcc dot gnu.org Reporter: gcc at cookiesoft dot de Target Milestone: --- Target: arm The following code will emit a warning on arm 32 bit compilers: ``` struct S { [[nodiscard]] S() {} }; int main() { S s; } ``` ``` : In function 'int main()&#

[Bug c++/93968] New: -Wswitch-default on exhaustive enum class gives warning

2020-02-28 Thread gcc at cookiesoft dot de
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at cookiesoft dot de Target Milestone: --- ``` enum class A { X, Y, Z }; int foo(A a) { switch (a) { case A::X: return 1; case A::Y: return 2; case A::Z: return

[Bug c++/93967] New: switch on exhaustive enum gives control reaches end of non-void function

2020-02-28 Thread gcc at cookiesoft dot de
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at cookiesoft dot de Target Milestone: --- ``` enum class A { X, Y, Z }; int foo(A a) { switch (a) { case A::X: return 1; case A::Y: return 2

[Bug c/87365] Uninitiliazed variable detection

2018-09-19 Thread gcc at cookiesoft dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87365 --- Comment #1 from gcc at cookiesoft dot de --- The volatile doesn't Change anything. I guess the combination of if and Else-while confuses him

[Bug c/87365] New: Uninitiliazed variable detection

2018-09-19 Thread gcc at cookiesoft dot de
Assignee: unassigned at gcc dot gnu.org Reporter: gcc at cookiesoft dot de Target Milestone: --- The following snippet does not detect the unitilialized variable int foo(volatile int cond) { int a; if (cond){ a = 0; } else { while (cond) { a