Switch Lowering in GCC
Posts RSS Switch lowering in GCC 2024-01-14 Introduction We have seen in a previous post that switch statements are more complex than they seem. The compiler is able to implement them as a decision tree (even though maybe it shouldn't). Is that everything it can do? In this post, I'll focus on gcc. All optimizations, except the bitset lowering, translate to clang. I'll be using the -O3 optimization flag unless indicated otherwise. I've also slightly edited gcc code and removed certain assertions
Read full article →