Gentoo gcc recipe for target 's-attrtab' failed

When updating to gcc-4.9.3 the build was failing with error

Makefile:2129: recipe for target 's-attrtab' failed

The internet was sparse on details, but as it turns out my virtual machine was running out of memory causing the build to crash.

By increasing the amount of memory from 512Mb to 1.5Gb, I was finally able to upgrade gcc.