https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87837
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 44939 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44939&action=edit gcc9-pr87837.patch Untested fix for this issue. Note, we should go through all of match.pd and for each TYPE_OVERFLOW_UNDEFINED not accompanied with !TYPE_OVERFLOW_SANITIZED try to think if that might cause some missed cases, construct testcases and fix if needed. Don't have spare cycles for that right now though.