If gcc ends in segmentation faults for a number of programs, it's very likely that you've got a bad ram chip, as was said before. To be certain, go to
http://www.memtest86.com where you can find a bootable program to test it. If it is bad, you can google for BadRAM, a patch to the kernel that reserves the bad sectors of RAM at boot and doesn't allow other programs to access them. That will of course require a kernel re-compile.