https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116278
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- lb a1,0(a5) // load -40 lui a0,%hi(.LC0) lui a4,%hi(c) addi a5,a1,9 //a5 = -31 slli a5,a5,48 srli a5,a5,48 // a5 = -31 sltu a1,a5,a1 // -31 <u -40 ? false neg a1,a1 // 0 or a1,a1,a5 // -31 slli a1,a1,48 srli a1,a1,48 I don't see anything wrong here ... Unless I missed something (is lb a signed load byte?)