https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87123
--- Comment #2 from Andy Koppe <andy.koppe at analog dot com> --- You are right. The test passes when casting to unsigned before negation.
andy.koppe at analog dot com Tue, 28 Aug 2018 03:18:01 -0700
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87123
--- Comment #2 from Andy Koppe <andy.koppe at analog dot com> --- You are right. The test passes when casting to unsigned before negation.