Created attachment 31004 [details] output from compilation using g++ (Debian 4.8.1-10) 4.8.1 Debian testing x64 I've been investigating the dynamic_bitset part of the tr2 specification. I've used boost's dynamic bitset, so I was basing the functionality from that. Either I'm using the resize function wrongly, or it's failing to set the bits as indicated. When using the resize(number of bits, value), the resize seems to work fine, but the value is ignored. I started to dig around; the resize function is defined as this in the header <tr2/dynamic_bitset> void resize(size_type __nbits, bool __value = false) { this->_M_resize(__nbits, __value); this->_M_Nb = __nbits; this->_M_do_sanitize(); } Is the value being defaulted to false, regardless of the input? The actual main() is at the end of the main.ii file. Another oddity is that this will not compile from the command line, but will from inside netbeans where I code, even with Wall and Wextra specified. If more info is needed, I'll oblige.
Created attachment 31005 [details] output from the compile(as seen from terminal)
Created attachment 31006 [details] Source code
Created attachment 31007 [details] Code output
First blush the problem is in _M_resize: it ignores the __value passed as argument. That can't be right. Ed can you have a look?
This is wrong. Testing a patch...
Created attachment 31017 [details] Patch dynamic_bitset... Here is the patch. I did a little extra work to move large functions offline and to fix other things that were broken. This class was dumped in before it was ready really. tested on x86_64-linux. I tried retesting this morning but it looks like bootstrap is broken. See what you think.
Comment on attachment 31017 [details] Patch dynamic_bitset... The new dynamic_bitset.tcc file should have a different doxygen block from the main header: +/** @file tr2/dynamic_bitset + * This is a TR2 C++ Library header. + */ I suggest: /** @file tr2/dynamic_bitset.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{tr2/dynamic_bitset}
By the way, I just fixed the bootstrap. When you are ready, please send the patch to the mailing list, thanks!
Also, your doxygen markup is not valid, this does not start a group: + //@{ + + /** + * @brief Global I/O operators for bitsets. + * That just adds the @brief to the next function, I think you want: /** * @defgroup Global I/O operators for bitsets. * @{ */
The pt.c fix worked but... Still getting: In file included from ../../gcc/gcc/lto/lto.c:3301:0: ./gt-lto-lto.h:153:6: error: ‘type_hash_cache’ was not declared in this scope ./gt-lto-lto.h:155:13: error: ‘type_hash_cache’ was not declared in this scope ./gt-lto-lto.h:161:6: error: ‘gimple_types’ was not declared in this scope ./gt-lto-lto.h:163:13: error: ‘gimple_types’ was not declared in this scope ./gt-lto-lto.h:173:6: error: ‘type_hash_cache’ was not declared in this scope ./gt-lto-lto.h:175:13: error: ‘type_hash_cache’ was not declared in this scope ./gt-lto-lto.h:180:6: error: ‘gimple_types’ was not declared in this scope ./gt-lto-lto.h:182:13: error: ‘gimple_types’ was not declared in this scope I have to run. I'll try again tonight.
I don't see that. Boot & test just completed successfully for me.
In my x86_64 -m64 build, gt-lto-lto.h has only 149 lines. Looks like your tree is in an inconsistent state.
Author: emsr Date: Sat Oct 19 01:31:19 2013 New Revision: 203841 URL: http://gcc.gnu.org/viewcvs?rev=203841&root=gcc&view=rev Log: 2013-10-18 Edward Smith-Rowland <3dw4rd@verizon.net> PR libstdc++/58729 * include/tr2/dynamic_bitset (_M_resize, resize): Use input value to set bits; (_M_do_left_shift, _M_do_right_shift, _M_do_to_ulong, _M_do_to_ullong, _M_do_find_first, _M_do_find_next, _M_copy_from_ptr, operator>>): Move long methods outline to... * include/tr2/dynamic_bitset.tcc: New. * include/Makefile.am: Add dynamic_bitset.tcc. * include/Makefile.in: Add dynamic_bitset.tcc. * testsuite/tr2/dynamic_bitset/pr58729.cc: New. Added: trunk/libstdc++-v3/include/tr2/dynamic_bitset.tcc trunk/libstdc++-v3/testsuite/tr2/dynamic_bitset/ trunk/libstdc++-v3/testsuite/tr2/dynamic_bitset/pr58729.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/Makefile.am trunk/libstdc++-v3/include/Makefile.in trunk/libstdc++-v3/include/tr2/dynamic_bitset
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58804 for work that will get this to work for -m32 also. I was using builtins for long rather than long long so the last patch failed with -m32. Sigh...
Author: emsr Date: Mon Oct 21 13:52:39 2013 New Revision: 203893 URL: http://gcc.gnu.org/viewcvs?rev=203893&root=gcc&view=rev Log: 2013-10-20 Edward Smith-Rowland <3dw4rd@verizon.net> PR libstdc++/58804 PR libstdc++/58729 * include/tr2/dynamic_bitset (__dynamic_bitset_base<_WordT, _Alloc>::_M_are_all_aux, __dynamic_bitset_base<_WordT, _Alloc>::_M_do_count): Use __builtin_popcountll() instead of __builtin_popcountl(). * include/tr2/dynamic_bitset.tcc (__dynamic_bitset_base<_WordT, _Alloc>::_M_do_find_first, __dynamic_bitset_base<_WordT, _Alloc>::_M_do_find_next): Use __builtin_ctzll() instead of __builtin_ctzl(). Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/tr2/dynamic_bitset trunk/libstdc++-v3/include/tr2/dynamic_bitset.tcc
Fixed.