https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91373
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- And Bugzilla asks you to read https://gcc.gnu.org/bugs before creating a new bug, and that page asks you to try -fsanitize=undefined to see if your code is undefined. If you'd done that you'd have been told your code is undefined.