i've done emerge system using gcc 3.1,but when emerge came to grub there was an error: after some time of experimentating i found out,that /usr/lib/gcc-lib/i686-pc-linux-gnu/ncurses.h is wrong,i renamed the file and grub compiled.
This should work now: ncurses-5.2.20020511-r1 supports GCC3.1 Thanks for reporting a problem though!