I think I'm seeing this in C code too with clang. I'm having fairly big code-generated switch-case statements in my CPU emulators with hundreds to thousands of case-blocks (Z80: [1], 6502: [2]), and those take up to 7 seconds to compile with -O3, which is really unusually long for a single C compilation unit of that size (compared to the same number of lines across many smaller functions). If the problem has exponential behaviour it could easily blow up to minutes or hours for larger functions.[1] https://github.com/floooh/chips/blob/d0f690f2598f967f75cb360...
[2] https://github.com/floooh/chips/blob/d0f690f2598f967f75cb360...