[Bug tree-optimization/101923] std::function's move ctor is slower than the copy one for empty source objects

2021-08-17 Thread dartdart26 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101923 Petar Ivanov changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug tree-optimization/101923] std::function's move ctor is slower than the copy one for empty source objects

2021-08-16 Thread dartdart26 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101923 --- Comment #5 from Petar Ivanov --- (In reply to Andrew Pinski from comment #4) > Hmm > > __tmp = MEM[(union _Any_data & {ref-all})&f]; > MEM[(union _Any_data * {ref-all})&f] = MEM[(union _Any_data & > {ref-all})&moved]; > MEM[(union _An

[Bug libstdc++/101923] std::function's move ctor is slower than the copy one for empty source objects

2021-08-16 Thread dartdart26 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101923 --- Comment #3 from Petar Ivanov --- Thank you for pointing the output on x86! Following that, I checked O2 and O3 on ARM64 and I see differences, though I cannot say what their actual impact is: 02: https://godbolt.org/z/P9Garznef O3: https:

[Bug libstdc++/101923] std::function's move ctor is slower than the copy one for empty source objects

2021-08-15 Thread dartdart26 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101923 --- Comment #1 from Petar Ivanov --- Benchmark code (using Google Benchmark): #include #include #include struct Car {}; static void copy(benchmark::State& state) { for (auto _ : state) { const auto f = std::function{}; const aut

[Bug libstdc++/101923] New: std::function's move ctor is slower than the copy one for empty source objects

2021-08-15 Thread dartdart26 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101923 Bug ID: 101923 Summary: std::function's move ctor is slower than the copy one for empty source objects Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity