I've had good luck with MemTest86...
http://www.memtest86.com
Throw it on a floppy or what have you and go to town.. should give you some idea. I also wouldn't leave out the cpu... compiling anything with choke on a faulty proc.
I would recommend attempting to compile something else as well... if it fails there then hardware is bout the only thing it could be.... download a linux kernel and compile it for the hell of it... see what happens.