2 ms·
But the optimizer doesn't give up in this case. It successfully figures out that the loop has no side effect except heating up your processor and eliminates it.
by adrianN 9y ago
But the optimizer doesn't give up in this case. It successfully figures out that the loop has no side effect except heating up your processor and eliminates it.
- iainmerrick 9y agoWhat's the advantage of eliminating the loop? If the compiler is able to do that analysis, why not flag the endless spin loop as a compilation error?
- kazagistar 9y agoLoop is inside a function, that can have no side effect conditionally. Function is used in multiple places and inlined. With inlined context, compiler can eliminate loop sometimes.
- deleted 9y ago[deleted]
- flamedoge 9y agoeffectively a no-op... isn't code after inf-loop also removed as it is considered unreachable?