https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83151
--- Comment #1 from Andreas Schwab <sch...@linux-m68k.org> --- The operand of ~ is promoted to int first, thus the type of the result is also int which is then implicitly converted to unsigned int on return.