https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70222
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 37956 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37956&action=edit gcc6-pr70222.patch This untested patch works. Though, if that is the right way to go, I'd bootstrap/regtest it with some statistics gathering hack to see how often does it trigger.