OpenSSL 0.9.8d seems to use a function-casting feature that is unsupported in gcc-4.2, but instead of generating a compile error, gcc-4.2 instead inserts invalid opcodes, resulting in random crashes due to SIGILL (Signal 4).
A patch was posted to the FreeBSD mailing list: http://groups.google.com/group/muc.lists.freebsd.current/msg/b1ab434aacaa1a54 - it does not apply cleanly to OpenSSL 0.9.8d, so I will post a modified patch.
Created attachment 120162 [details, diff]
Patch for OpenSSL 0.9.8d with gcc-4.2
Here's a modified version of the patch posted on the FreeBSD mailing list. This applies cleanly to OpenSSL 0.9.8d.
*** This bug has been marked as a duplicate of bug 158324 ***