* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_set compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
@ 2012-01-16 1:51 ` paolo.carlini at oracle dot com
2012-01-16 1:53 ` [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset " roman at binarylife dot net
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-16 1:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fdumont at gcc dot gnu.org
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-16 01:39:55 UTC ---
Please provide details about the specific Rev, thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
2012-01-16 1:51 ` [Bug libstdc++/51866] " paolo.carlini at oracle dot com
@ 2012-01-16 1:53 ` roman at binarylife dot net
2012-01-16 2:53 ` paolo.carlini at oracle dot com
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: roman at binarylife dot net @ 2012-01-16 1:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
--- Comment #2 from Roman Kononov <roman at binarylife dot net> 2012-01-16 01:50:37 UTC ---
it is been bisected...
r183180 is bad
r170936 is good
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
2012-01-16 1:51 ` [Bug libstdc++/51866] " paolo.carlini at oracle dot com
2012-01-16 1:53 ` [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset " roman at binarylife dot net
@ 2012-01-16 2:53 ` paolo.carlini at oracle dot com
2012-01-16 3:31 ` paolo.carlini at oracle dot com
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-16 2:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-16 01:52:47 UTC ---
If we are lucky, this issue is even the same as 51845. Thanks for the neat
testcase.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
` (2 preceding siblings ...)
2012-01-16 2:53 ` paolo.carlini at oracle dot com
@ 2012-01-16 3:31 ` paolo.carlini at oracle dot com
2012-01-16 12:21 ` paolo.carlini at oracle dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-16 3:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2012-01-16
CC|fdumont at gcc dot gnu.org |
AssignedTo|unassigned at gcc dot |fdumont at gcc dot gnu.org
|gnu.org |
Target Milestone|--- |4.7.0
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
` (3 preceding siblings ...)
2012-01-16 3:31 ` paolo.carlini at oracle dot com
@ 2012-01-16 12:21 ` paolo.carlini at oracle dot com
2012-01-16 12:40 ` redi at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-16 12:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
` (4 preceding siblings ...)
2012-01-16 12:21 ` paolo.carlini at oracle dot com
@ 2012-01-16 12:40 ` redi at gcc dot gnu.org
2012-01-16 12:54 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-01-16 12:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-16 12:33:35 UTC ---
in _Hashtable::_M_insert(Arg&&, false_type):
const key_type& __k = this->_M_extract()(__v);
that takes a reference to the key part of the value, then:
__new_node = _M_allocate_node(std::forward<_Arg>(__v));
that invalidates the value, while __k stills refers to the moved-from object.
then:
size_type __n = _M_bucket_index(__k, __code);
_BaseNode* __prev = _M_find_before_node(__n, __k, __code);
that uses the invalid key
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
` (5 preceding siblings ...)
2012-01-16 12:40 ` redi at gcc dot gnu.org
@ 2012-01-16 12:54 ` redi at gcc dot gnu.org
2012-01-16 12:56 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-01-16 12:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-16 12:38:56 UTC ---
the fix is to move the declaration of __k later, initializing it from the value
in the new node, where it's been moved to:
this->_M_extract()(__new_node->_M_v)
computing the hash code above can be done from
this->_M_hash_code(this->_M_extract()(__v))
instead of this->_M_hash_code(__k)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
` (6 preceding siblings ...)
2012-01-16 12:54 ` redi at gcc dot gnu.org
@ 2012-01-16 12:56 ` redi at gcc dot gnu.org
2012-01-18 20:31 ` fdumont at gcc dot gnu.org
2012-01-18 20:53 ` fdumont at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2012-01-16 12:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-16 12:41:04 UTC ---
P.S. it looks as though the python pretty printers need to be updated to
support the new hashtable code
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
` (7 preceding siblings ...)
2012-01-16 12:56 ` redi at gcc dot gnu.org
@ 2012-01-18 20:31 ` fdumont at gcc dot gnu.org
2012-01-18 20:53 ` fdumont at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: fdumont at gcc dot gnu.org @ 2012-01-18 20:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
--- Comment #7 from François Dumont <fdumont at gcc dot gnu.org> 2012-01-18 20:18:20 UTC ---
Author: fdumont
Date: Wed Jan 18 20:17:57 2012
New Revision: 183285
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183285
Log:
2012-01-18 François Dumont <fdumont@gcc.gnu.org>
Roman Kononov <roman@binarylife.net>
PR libstdc++/51866
* include/bits/hashtable.h (_Hashtable<>::_M_insert(_Arg, false_type)):
Do not keep a reference to a potentially moved instance.
* testsuite/23_containers/unordered_multiset/insert/51866.cc: New.
* testsuite/23_containers/unordered_multimap/insert/51866.cc: New.
Added:
trunk/libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/51866.cc
trunk/libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/51866.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/hashtable.h
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/51866] [c++0x][4.7 Regression] unordered_multiset compares moved-out values
2012-01-16 1:44 [Bug libstdc++/51866] New: [c++0x][4.7 Regression] unordered_set compares moved-out values roman at binarylife dot net
` (8 preceding siblings ...)
2012-01-18 20:31 ` fdumont at gcc dot gnu.org
@ 2012-01-18 20:53 ` fdumont at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: fdumont at gcc dot gnu.org @ 2012-01-18 20:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51866
François Dumont <fdumont at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #8 from François Dumont <fdumont at gcc dot gnu.org> 2012-01-18 20:36:47 UTC ---
This issue is solved now.
Thanks for the great test case.
^ permalink raw reply [flat|nested] 11+ messages in thread