The Standard's One Program Rule allows implementations to impose arbitrary "translation limits" the designers see fit, and behave in arbitrary fashion if they are violated, provided only that for every translation limit given in the Standard there exists at least One Program which the implementation processes correctly. An implementation may do anything it likes when given any other program.
Further, the Standard only concerns itself with program behavior, and not with generated code, and consequently makes no practical distinction between a program that gets stuck in an endless loop, and one which would run for trillions of years with no side effects before producing a result.
In general, the proper answer to the question "Would the C Standard allow a compiler to behave in some stupid and useless fashion X" is "Probably. So?" The Standard makes no effort to forbid compilers from doing stupid things, and the fact that the Standard would allow a conforming implementation to do something implies no judgment as to whether such behavior might make an implementation useless for some (or even all) purposes.