[Bug other/94403] New: Missed optimization bswap
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94403 Bug ID: 94403 Summary: Missed optimization bswap Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: boris_oncev at hotmail dot com Target Milestone: --- full code: https://godbolt.org/z/zjNqYV template auto reverse(T num) { // misses optimization when num is int32_t OK for int64_t auto* bytes = reinterpret_cast(&num); // misses optimization for both 32 and 64 bit ints //auto* bytes = reinterpret_cast(&num); constexpr auto size = sizeof(num); for (int i = 0; i < size / 2; i++) { std::swap(bytes[i], bytes[size-i-1]); } return num; }
[Bug other/94403] Missed optimization bswap
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94403 Boris changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE --- Comment #1 from Boris --- Very similar *** This bug has been marked as a duplicate of bug 93328 ***
[Bug tree-optimization/93328] missed optimization opportunity in deserialization code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93328 Boris changed: What|Removed |Added CC||boris_oncev at hotmail dot com --- Comment #4 from Boris --- *** Bug 94403 has been marked as a duplicate of this bug. ***
[Bug tree-optimization/93328] missed optimization opportunity in deserialization code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93328 --- Comment #5 from Boris --- full code: https://godbolt.org/z/zjNqYV template auto reverse(T num) { // misses optimization when num is int32_t OK for int64_t auto* bytes = reinterpret_cast(&num); // misses optimization for both 32 and 64 bit ints //auto* bytes = reinterpret_cast(&num); constexpr auto size = sizeof(num); for (int i = 0; i < size / 2; i++) { std::swap(bytes[i], bytes[size-i-1]); } return num; }
[Bug c++/95164] New: ICE regression starting with 9.3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95164 Bug ID: 95164 Summary: ICE regression starting with 9.3 Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: boris_oncev at hotmail dot com Target Milestone: --- Reproduction code on godbolt, showing ICE on 9.3 & 10.1 but works fine on 9.2 https://godbolt.org/z/-Dr7Lc #include struct A { }; struct B { A a; }; struct C { }; struct D { C c; B b; }; struct E { D d; }; template struct F { F() { A a; A& a2 = a; std::vector return_values; return_values.push_back({ {C{}, {B{a2}}} }); } };
[Bug c++/96115] New: Char literal, decays to a pointer when passed to function pointer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96115 Bug ID: 96115 Summary: Char literal, decays to a pointer when passed to function pointer Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: boris_oncev at hotmail dot com Target Milestone: --- Example code: struct SL{ template SL(const char (&Str)[N]) {} }; int foo(SL x) { return 2; } int main() { int (*f)(SL) = &foo; foo("asd"); // works fine f("asd"); // error could not convert '(const char*) to SL } Godbot link: https://godbolt.org/z/vo8lOf works on other compilers clang, msvc and icc
[Bug c++/86648] New: [9 Regression] ICE on class template argument deduction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86648 Bug ID: 86648 Summary: [9 Regression] ICE on class template argument deduction Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: boris_oncev at hotmail dot com Target Milestone: --- On compiler explorer using the gcc (trunk) compiler I get an ICE. https://godbolt.org/g/NPtXxH The same code works on earlier versions 8.1 and 7.3 and Clang. ``` #include template struct Foo { static constexpr int a = 3; }; template struct Bar { static constexpr std::tuple baz = { 1, 2, Foo::a }; // add ^ // to make it compile }; int main() { return std::get<2>(Bar::baz); } ```
[Bug c++/86648] [9 Regression] ICE on class template argument deduction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86648 --- Comment #2 from Boris --- (In reply to Marek Polacek from comment #1) > I don't see any ICE with -std=c++17. Did you try it on godbolt, or locally(maybe you have newer version than godbolt) ?
[Bug c++/107282] New: ICE on valid code template + overloaded + visit
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107282 Bug ID: 107282 Summary: ICE on valid code template + overloaded + visit Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: boris_oncev at hotmail dot com Target Milestone: --- ICE on >=C++17 on all supported versions https://godbolt.org/z/5exMcrhYz