And indeed, clang is able to do it for unsigned, too: https://godbolt.org/z/36r1Maq7b
gcc doesn't seem to implement this optimization at all.
Technically it should be possible for the <=n case, too: An infinite loop is undefined behavior, so the compiler is allowed to assume it doesn't happen. But I guess (for good reasons) compiler writers are reluctant to exploit that too heavily (or it's just about ordering of optimization passes).