https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89713
--- Comment #3 from Feng Xue <fxue at os dot amperecomputing.com> --- Yes, people seldom write an empty loop in real application. These loops are always by-products of some loop optimizations, such as loop unswitch and loop split etc. Pragma does be a means to pass loop information to gcc, but have to modify existing source. Actually, iterating an std::map, which is constructed using a tree, even without doing extra things, could take quite a few cpu cycles, this is different from a simple integer-index loop. In a real benchmark, an empty std::map loop occupies more than 6% of total application time.