Just to follow up: It appears to be a bug in gcc's -fgcse optimization (which is enabled by -O2). Toggling -fno-gcse on gcc 4.2.2 eliminates the symptoms. The code in question is simple enough, and there were enough bugs reported against -fgcse, that we are content to let the blame fall on -fgcse, and move on. Thanks for the suggestions. Rune Lund Olesen wrote:
For a possible fix (however quick and dirty as it may be), you could try to switch to using boost::variant instead (if at all possible).
If it makes sense to use boost::variant in you context you might as well be satisfied with that.
Another thing that could be checked is that the code involved with the any is compiled with the same compiler version and boost version (a minimal test will of course help to identify such a problem)
-- Rune
On Sun, Mar 15, 2009 at 6:42 PM, Sohail Somani
mailto:sohail@taggedtype.net> wrote: John wrote: > If you know of such a bug or quirk in either GCC or boost::any, or of a > write-up of this somewhere... or even some idle speculation... it could > save us a lot of time tracking this down.
Don't know anything off-hand but valgrind may be able to pinpoint where something is going wrong.
-- Sohail Somani http://uint32t.blogspot.com
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org mailto:Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users