https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71753
--- Comment #6 from Ćukasz Spintzyk <lukasz.spintzyk at displaylink dot com> --- I confirm changing the code to use unsigned int fixed the problem. Also there is no signed overflow errors. Thanks a lot.