https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86995
--- Comment #4 from Vlad Lazar <vlad.lazar at arm dot com> --- That's right. It's not the right fix. The actual cause is the use of wi::add in r263591, which does not set the flag in case of underflow. The correct way is to use wi::add for addition and wi::sub for substraction. I'm testing a patch which does that.