https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61996
--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> --- Created attachment 33366 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33366&action=edit proposed patch for 5,4.9,4.8 David, could you please try out this patch and see if it fixes the issues for you? If so, I'll add a test case and commit it.