This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/80335] perf of copying std::optional<trivial>
- From: "sgunderson at bigfoot dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 31 Aug 2017 14:50:41 +0000
- Subject: [Bug libstdc++/80335] perf of copying std::optional<trivial>
- Auto-submitted: auto-generated
- References: <bug-80335-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80335
sgunderson at bigfoot dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sgunderson at bigfoot dot com
--- Comment #1 from sgunderson at bigfoot dot com ---
This also affects the _returning_ std::optional; since it is not trivially copy
constructible, std::optional<int> must be returned (at least on amd64) by means
of a hidden parameter instead of in registers.
Since this affects the return type ABI, it can't be changed easily
after-the-fact, so if possible, it should be fixed before C++17 support becomes
non-experimental.