https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78546
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 40174 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40174&action=edit gcc7-pr78546.patch Untested fix for 2), i.e. the wrong-code bug. For 1), i.e. the optimization regression, I think it should be tracked in a separate PR.