dev-lang/swi-prolog versions 5.9.6 and 5.9.7 can't be emerged correctly when the "gmp" USE flag is unset. The last version that works is 5.9.5. I also filed a bug in upstream's bugzilla: http://gollem.science.uva.nl/bugzilla/show_bug.cgi?id=444
Created attachment 217973 [details] emerge --info
Thanks for the report. Looks like upstream recommends always compiling with gmp nowadays, but also have a fix in latest git... assigning to prolog team.
Thanks for reporting this upstream. I've pulled the upstream patch into swi-prolog-5.9.7. Keri