https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
Jonathan Wakely changed:
What|Removed |Added
Status|REOPENED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #23 from Jonathan Wakely ---
Author: redi
Date: Tue Apr 23 09:55:33 2019
New Revision: 270502
URL: https://gcc.gnu.org/viewcvs?rev=270502=gcc=rev
Log:
Fix std::variant regression caused by never-valueless optimization
A regression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #22 from Jonathan Wakely ---
I'm tempted to just rip out this stuff entirely, and go back to only offering
the strong exception safety guarantee for trivially copyable types, and so
variants would only be never-valueless if all
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
Jonathan Wakely changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Resolution|FIXED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
Jonathan Wakely changed:
What|Removed |Added
Status|REOPENED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #19 from Jonathan Wakely ---
Author: redi
Date: Fri Apr 5 16:56:09 2019
New Revision: 270170
URL: https://gcc.gnu.org/viewcvs?rev=270170=gcc=rev
Log:
PR libstdc++/87431 re-adjust never-valueless optimizations
Avoid creating
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #18 from Jonathan Wakely ---
Proposed new patch posted:
https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00142.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
Jonathan Wakely changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Resolution|FIXED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #16 from Jonathan Wakely ---
Author: redi
Date: Tue Jan 8 23:15:49 2019
New Revision: 267743
URL: https://gcc.gnu.org/viewcvs?rev=267743=gcc=rev
Log:
Pretty printer test fixes and improvements
Test that StdUniquePtrPrinter
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
Jonathan Wakely changed:
What|Removed |Added
Status|REOPENED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #14 from Jonathan Wakely ---
Author: redi
Date: Sun Jan 6 20:52:34 2019
New Revision: 267614
URL: https://gcc.gnu.org/viewcvs?rev=267614=gcc=rev
Log:
PR libstdc++/87431 fix regression introduced by r264574
The previous patch for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #13 from Antony Polukhin ---
Yeah... but some whitelist of types to move could be hardcoded. For example
std::basic_string, std::vector, std::unique_ptr and std::shared_ptr could be
safely moved and `valueless_by_exception()` never
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #12 from Jonathan Wakely ---
Yeah that unconditional move might actually be more expensive than just
constructing directly. E.g. if the move constructor isn't really cheap, or if
it will memcpy a large object. If an exception is rare
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #11 from Antony Polukhin ---
Looks good.
Note that boost::variant went further: if all the types are nothrow movable
then variant always does the trick with moving from temporary. In that way
`valueless_by_exception()` like states
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #10 from Jonathan Wakely ---
Maybe like this:
--- a/libstdc++-v3/include/std/variant
+++ b/libstdc++-v3/include/std/variant
@@ -439,7 +439,7 @@ namespace __variant
constexpr bool
_M_valid() const noexcept
{
-
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
Jonathan Wakely changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Resolution|FIXED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #8 from Antony Polukhin ---
Here's an idea:
Make valueless_by_exception() always false if all the alternatives are
trivially copyable. Implement copying and constructions/emplace for such
variants as a construction of a temporary +
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
ensadc at mailnesia dot com changed:
What|Removed |Added
CC||ensadc at mailnesia dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #6 from Antony Polukhin ---
(In reply to Jonathan Wakely from comment #5)
> I'm going to mark this as fixed, I'm uncomfortable doing a smarter fix that
> would be more fragile.
+1. I'll keep searching for a less fragile solution.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
Jonathan Wakely changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #4 from Jonathan Wakely ---
Author: redi
Date: Tue Sep 25 14:59:16 2018
New Revision: 264574
URL: https://gcc.gnu.org/viewcvs?rev=264574=gcc=rev
Log:
PR libstdc++/87431 optimise valueless_by_exception()
If a std::variant can never
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #3 from Jonathan Wakely ---
That makes me a little uncomfortable. Currently you can use something like:
struct X
{
#ifndef NDEBUG
X(int) noexcept(false);
#endif
//...
};
bool test(std::variant const& v)
{
return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #2 from Antony Polukhin ---
New intrinsic could be added into the GCC... something like
__builtin_all_constructors_nothrow(type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
--- Comment #1 from Jonathan Wakely ---
Can we do any better than this?
--- a/libstdc++-v3/include/std/variant
+++ b/libstdc++-v3/include/std/variant
@@ -439,6 +439,8 @@ namespace __variant
constexpr bool
_M_valid() const noexcept
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431
Jonathan Wakely changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
25 matches
Mail list logo