[Spread-users] crash bug report
taj.khattra at pobox.com
Wed Feb 11 18:22:48 EST 2004
On Wed, Feb 11, 2004 at 05:30:17PM -0500, Jonathan Stanton wrote:
> I'll admit I do not have the C standard memorized. Does anyone else know
> if this is valid compiler behavior on platforms where the memcpy is
> required for alignment reasons?
i'm not a language lawyer, but what gcc is doing seems reasonable
to me: you're telling it that num_vs_ptr points to an int (and by
implication, is properly aligned), and gcc believes you, so it
shortcuts the memcpy() to a direct assignment.
anyways, the gcc option -fno-builtin-memcpy should disable gcc's
builtin memcpy (but i still think Mikhail's fix is valid)
More information about the Spread-users