newer gcc versions provide a -freport-bug flag. it would be nice if portage could detect whether the active $CC supported this, and if so, automatically append it (if it doesn't already exist) to CFLAGS & CPPFLAGS. when such a crash did occur and gcc did dump info, portage could mention it in the bug summary. this would take a bit more work as the output looks something like: ... Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/ccsiCi48.out file, please attach this to your bugreport. portage would want to scrape the log, look for that last line, and then copy the output file to $T. i'm not sure it's possible to control the location normally :/.
-freport-bug sends files to the tmpdir as determined by libiberty's choose_tmpdir, which on Linux chooses the first available of: TMPDIR TMP TEMP /var/tmp /usr/tmp /tmp cwd so one solution would be to export TMPDIR=${T}. another solution might be to scrape the build log and re-run the failing gcc command with TMPDIR=${T}, but that might be even worse than the previous solution (cmake comes to mind).
it has come to my attention that we already export TMPDIR=${T}. therefore, it should be sufficient to automatically detect an ICE and ask the user to attach ${T}/cc*.