http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58122
--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to Oleg Endo from comment #0) > > I've checked this with an SH cross compiler setup, but I don't think it > matters. > The loops do get eliminated if the number of loop iterations is max. 17, for > both the reduced example and the originally reported case. Forgot to mention: The loops get eliminated when compiling with -O3