https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66620
--- Comment #12 from Chen Gang <gang.chen.5i5j at gmail dot com> --- Created attachment 35869 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35869&action=edit The result before lsetup optimization The lsetup information is below: lsetup (loop_begin, loop_end) count. R0 will add 1 for each times, in our case, it is initialized to 0 before lsetup(). After the loop_end, in our case, it needs "R0 += 1" to increase the last count.