Ben Wing wrote:
the crashes tend to occur in random places. they vary from one build
to the next. often in pdump. vc++ does crash somewhere in pdump, in
differing places from build to build. compiling sans union type makes
the problem disappear.
once i tracked the problem down and it was that gcc did not do
structure assignments completely in parallel in all situations. with
sufficiently complicated expressions of the form x = f(x), where x is
a structure, it would sometimes think that it had correctly computed
one of the fields, and assign it a value, when in fact the old value
was still needed elsewhere in the expression. i wrote to the gcc
developers and they got very defensive and quoted a section of the
ansi standard, saying "well, we agree your expected behavior is
reasonable but *technically* it's not required by the ansi standard."
this only happened with mule and error-checking, because the
expression was much more complicated that way. by rewriting it using
temporaries, the problem went away.
This all smells like a type punning bug; does it go away if you
disable optimisation?
--
Glynn Clements <glynn.clements(a)virgin.net>