https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64005
--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> --- Ian explained in an offline communication: It's more likely that with -O2 some dead pointers appears in a stack frame, and cause the garbage collector to think that the values are still live, and therefore they are not collected, and therefore they are not finalized. The gccgo garbage collector is not precise. Which pointers are left live in a stack frame varies a lot depending on processor and optimization level.