https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87635
--- Comment #2 from Riccardo <rm at gnu dot org> --- Just for the reference, I backported the fix also to gcc 6.5 It applied almost cleanly. Given your comment, I don't think it is worth opening a new bug just for that? So I leave the patch here for the record.