https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115647
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> --- (In reply to David Malcolm from comment #0) > In the below `for` statement, the `char` counter `i` has a smaller range > than the value of the `int` condition `n` (in this case 500) hence it will > overflow and wrap around when incremented beyond its max range value (in > this case 127) before reaching that value, resulting in an infinite loop. Note '127' assumes signed char by default, whereas on some targets the max range value is 255. But when comparing against 500 it doesn't affect the logic.