[Bug libstdc++/105844] std::lcm(50000, 49999) is UB but accepted in a constexpr due to cast to unsigned

2022-06-04 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105844 --- Comment #3 from Goswin von Brederlow --- Created attachment 53082 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53082&action=edit Working patch for detecting UB This will abort if the arguments are too large instead of static_assert,

[Bug libstdc++/105844] std::lcm(50000, 49999) is UB but accepted in a constexpr due to cast to unsigned

2022-06-03 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105844 --- Comment #2 from Goswin von Brederlow --- I know the patch doesn't work yet, the static_asserts aren't constexpr. But hopefully it gives someone enough of an idea to fix it.

[Bug libstdc++/105844] std::lcm(50000, 49999) is UB but accepted in a constexpr due to cast to unsigned

2022-06-03 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105844 Goswin von Brederlow changed: What|Removed |Added CC||goswin-v-b at web dot de --- Com

[Bug libstdc++/105844] New: std::lcm(50000, 49999) is UB but accepted in a constexpr due to cast to unsigned

2022-06-03 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105844 Bug ID: 105844 Summary: std::lcm(5, 4) is UB but accepted in a constexpr due to cast to unsigned Product: gcc Version: 12.1.0 Status: UNCONFIRMED Sever

[Bug target/105521] missed optimization in modulo arithmetic

2022-05-08 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105521 --- Comment #3 from Goswin von Brederlow --- (In reply to Andrew Pinski from comment #1) > This requires having a, 64bit/32bit (and 128bit/64bit) pattern really. So > this is both a middle-end issue and a target issue. > > Note there might be a

[Bug c/105521] New: missed optimization in modulo arithmetic

2022-05-07 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105521 Bug ID: 105521 Summary: missed optimization in modulo arithmetic Product: gcc Version: 11.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c

[Bug middle-end/99578] [11 Regression] gcc-11 -Warray-bounds or -Wstringop-overread warning when accessing a pointer from integer literal

2022-03-19 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 --- Comment #38 from Goswin von Brederlow --- (In reply to Jonathan Wakely from comment #34) > (In reply to Goswin von Brederlow from comment #29) > > There is no garantee in the C standard that '(type *)CONSTANT' will actually > > point to the h

[Bug middle-end/99578] [11/12 Regression] gcc-11 -Warray-bounds or -Wstringop-overread warning when accessing a pointer from integer literal

2022-03-07 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 --- Comment #29 from Goswin von Brederlow --- (In reply to Jakub Jelinek from comment #26) > That is nonsense. The amount of code in the wild that relies on (type > *)CONSTANT > working is insane, you can't annotate it all. And it has worked f

[Bug c/104828] New: Wrong out-of-bounds array access warning on literal pointers

2022-03-07 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104828 Bug ID: 104828 Summary: Wrong out-of-bounds array access warning on literal pointers Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal

[Bug c++/104514] New: add feature to create a pointer to a fixed address as constexpr

2022-02-12 Thread goswin-v-b at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104514 Bug ID: 104514 Summary: add feature to create a pointer to a fixed address as constexpr Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal