I had a similar issue for the longest time. When I compiled code my PC would just randomly freeze for no conceivable reason. No blue screen no nothing - just complete halt.
I noticed my PC jumping to 105% - 110% load in my task manager so I went ahead and disabled all auto-tweaking **** in the BIOS (My particular ASUS mobo had something called Ai Tweak). Fixed it right up.