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 on Hacker News · Front page on Oct 31, 2026. Since then it has appeared in 73 checks on 2 different days. Its best position was #6 of 30, reached on Oct 31, 20:37 UTC. It dropped off the list after Nov 1, 02:52 UTC. The same link also trended on Lobsters, which raises its cross-platform score.
Position on Hacker News · Front page at every check (lower is better).
Best rank per day (UTC).
Platform metric as reported by Hacker News.
| List | Best | Days | Checks | Last seen |
|---|---|---|---|---|
| Hacker News · Front page | #6 | 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. It was last on the list on Nov 1, 02:52 UTC, after 2 days of trending.
#6 on Hacker News · Front page, on Oct 31, 20:37 UTC. Trendoday checks this list every 15 minutes.
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.