fix Issue 13152 - Compiler high cpu usage and never ends

Partially revert "Merge pull request #2448 from hpohl/10752"