https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103103
--- Comment #3 from Kyryl Melekhin <k.melekhin at gmail dot com> --- Thank you! I figured that this has something to do with being UB behavior with int overflow, however it's strange to find this kind of bug only on 1 compiler, with no possible warnings or idications that something is wrong. Perhaps a warning of UB into overflow from compiler be nice. Have a good day.