On Wed, Apr 18, 2012 at 2:44 PM, Richard Henderson wrote: > On 04/18/2012 05:39 AM, Jan Hubicka wrote: >> Well, if SJLJ lowering happens as gimple pass somewhere near the end of >> gimple >> queue, this should not be problem at all. (and implementation would be >> cleaner) > > If you can find a clean way of separating sjlj expansion from dw2 expansion, > please do. But there's a lot of code shared between the two. I see nothing > wrong with always expanding via tablejump.
Hello, This patch makes it so... well, almost anyway. With this patch, all SJLJ exception dispatch tables with more than 5 case labels are are expanded as a tablejump or a casesi. With the existing code: * a 1-case dispatch is expanded as a simple jump by code in except.c * a >1-case dispatch is built as a GIMPLE_SWITCH and expanded via expand_case as a decision tree if there are fewer than case_values_threshold() cases, or a tablejump or casesi for everything else If my patch is OK, this changes to: * a 1-case dispatch is expanded as a simple jump by code in except.c (unchanged) * a >1-case dispatch is built as a VEC of CASE_LABEL nodes and expanded via expand_sjlj_dispatch_table as a decrement-chain if there are fewer than 5 cases, or a tablejump or casesi for everything else Bootstrapped&tested on powerpc64-unknown-linux-gnu, and multilib-bootstrapped on x86_64-unknown-linux-gnu with java enabled and with --enable-sjlj-exceptions. OK for trunk? Ciao! Steven
sjlj_tablejump.diff
Description: Binary data