code::blocks doesn't back up files and also does not perform atomic saves.
While I can't tell what has been going on in your particular case on your dying machine, I can tell with high confidence that neither of these statements is true (I'm the person who wrote the code that does the saving to files somewhat over a decade ago).
Code::Blocks only ever directly "overwrites" a file if the file does not already exist, but that is a non-issue (the write can of course still fail if your CPU dies, but there's not really much you can do about that).
If the file already exists on-disk, Code::Blocks will write to a temporary file and then perform an atomic swap/move (using MoveFileEx under Windows, rename under POSIX).
For people with unreliable/failing systems or power supply, there used to be a save-every-soandsooften plugin as well, it would write the editor's contents to a backup file (not overwriting the original one!) every couple of minutes.
If you are unhappy with Code::Blocks, you may want to give CodeLite a try. It's way less heavyweight than any other alternative (like... 5% the overall size, and 15% the memory requirements of VisualStudio). From what I can tell, it works pretty well, too.