Switch Lowering in GCC
0 comments
- Points181
- Comments34
0 comments
Story details from Hacker News ↗ · linked article on xoranth.net.
Switch Lowering in GCC was first seen by Trendoday on Oct 31, 2026. Since then it has appeared in 73 checks on 2 different days. It reached #6 on Hacker News · Front page on Oct 31, 2026 UTC. It was last seen on Hacker News · Front page on Nov 1, 02:52 UTC. The same link also trended on Lobsters, which raises its cross-platform score.
Best recorded rank on Hacker News · Front page per UTC day.
Best rank per day (UTC).
| List | Best | Days | Checks | Last seen |
|---|---|---|---|---|
| Hacker News · Front page | #6 · Badge | 2 | 73 | |
| LLobsters · Hottest Switch lowering in GCC | same link | |||
A few top-level comments from Hacker News, shortened. Read the full thread on Hacker News.
I once played around with having a very large switch statement (all mac address manufactors in one switch) and in LLVM it would compile fine without optimizations, but if I turned optimizations on it would just spend around half an hour compiling it. I think GCC did it faster, but its been some time ago since I did…
> The switch in sparse_8 could be simplified by dividing x by eight before the jump. Interestingly, gcc doesn't find this simplification. It could not because that would ensure that 7 values for each case would be handled by function calls instead of the default case - 0/8 is 0, but 3/8 is also 0
What a shame for clang and gcc! They still don't implement perfect hashes for large sparse switch tables. I did that recently for my rcc C compiler, and it was just a single day of work. Esp. beneficial for unicode work. The LLVM patch was rejected a decade ago. Gcc has several unicode patches sitting in branches,…
Archived daily, weekly and monthly lists that include this entry.
Not at the moment. Its last recorded appearance was on Nov 1, 02:52 UTC.
#6 on Oct 31, 2026 UTC.
It was first seen on Oct 31, 2026 and has been on the list on 2 days (73 checks) since.
181 points and 34 comments; submitted by signa11 on Oct 31, 2026.