Why do compilers seems to be polite toward loops that do nothing and do not eliminate them?
Does the C standard require loops to take some time?
Example, the f
No, there is no guarantee: (quotation from N1570, 5.1.2.3 Program execution)
1 The semantic descriptions in this International Standard describe the behavior of an abstract machine in which issues of optimization are irrelevant.
Anyway, the C standard only specifies the behaviour of your program when it is executed on an abstract machine, which can have infinite memory and/or CPUs.