The attached file demonstrates a bug in the phobos runtime. I'm running dev-util/gcc-4.1.2 with USE=d, which is brining in gdc-0.24. The bug happens with the gdc binary distribution as well, and I have attempted to report this upstream as well (sourceforge gdc bug 1805344).
Created attachment 132271 [details] Demonstrate readln() bug
btw, the duplicate bug reports you filed are still set to "Open" status ...
Moving back to wranglers since Anant left Gentoo.
No more explicit D maintainer, so reassigning to toolchain instead.
gcc-4.1 is dead upstream. No one from the toolchain team was involved with the D port, but if they want to fix this, reopen it and go for it.