I just did an emerge clean world. Among others, it deleted gcc 3.1, because I had 3.1.1 installed. This has broken a large number of applications, because the loader could not find several libraries any longer (among them the C++ lib): gcc 3.1 kept its libs in /usr/lib/, gcc 3.1.1 in /usr/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/. ldconfig seems to fix that, it should be done automatically! (it gave me quite a shock)
i think calling env-update would be better ... but same result end result for you and same good idea :)
OK, will be fixed in portage 2.0.28.