Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-14 Thread Richard Henderson
On 05/12/12 06:00, Steven Bosscher wrote: * toplev.c (process_options): Fail for sjlj exceptions if the target machine has no casesi insn and no tablejump insn. Looks good. How many targets have neither case/tablejump? r~

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-14 Thread Steven Bosscher
On Mon, May 14, 2012 at 4:23 PM, Richard Henderson r...@redhat.com wrote: On 05/12/12 06:00, Steven Bosscher wrote:         * toplev.c (process_options): Fail for sjlj exceptions if the target machine         has no casesi insn and no tablejump insn. Looks good.  How many targets have

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-14 Thread DJ Delorie
For rl78 there is a comment in gcc/config/rl78/rl78.h that suggests there should be a tablejump insn, but it's not there. The only unconditional branches rl78 has are immediate and register-indirect, i.e. BR $label and BR AX. This is unfortunate because rl78 is a #define DWARF2_UNWIND_INFO 0

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-14 Thread Richard Henderson
On 05/14/12 12:59, DJ Delorie wrote: For rl78 there is a comment in gcc/config/rl78/rl78.h that suggests there should be a tablejump insn, but it's not there. The only unconditional branches rl78 has are immediate and register-indirect, i.e. BR $label and BR AX. The later is certainly how

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-12 Thread Steven Bosscher
On Wed, Apr 18, 2012 at 2:44 PM, Richard Henderson r...@redhat.com 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

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-12 Thread Jan Hubicka
On Wed, Apr 18, 2012 at 2:44 PM, Richard Henderson r...@redhat.com 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

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-12 Thread Steven Bosscher
On Sat, May 12, 2012 at 3:49 PM, Jan Hubicka hubi...@ucw.cz wrote: On Wed, Apr 18, 2012 at 2:44 PM, Richard Henderson r...@redhat.com 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

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-12 Thread Eric Botcazou
Isn't SJLJ used by default for Ada on all targets? Nope, Ada uses the same EH scheme as the other compilers, except for a few cases where it uses its own __builtin_setjmp/__builtin_longjmp based scheme. -- Eric Botcazou

What do do with the exceptional case of expand_case for SJLJ exceptions

2012-04-18 Thread Steven Bosscher
Hello, If I move GIMPLE_SWITCH lowering from stmt.c to somewhere in the GIMPLE pass pipeline, I run into an issue with SJLJ exceptions. The problem is that except.c:sjlj_emit_dispatch_table() builts a GIMPLE_SWITCH and calls expand_case on it. If I move all non-casesi, non-tablejump code out of

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-04-18 Thread Richard Guenther
On Wed, Apr 18, 2012 at 10:35 AM, Steven Bosscher stevenb@gmail.com wrote: Hello, If I move GIMPLE_SWITCH lowering from stmt.c to somewhere in the GIMPLE pass pipeline, I run into an issue with SJLJ exceptions. The problem is that except.c:sjlj_emit_dispatch_table() builts a

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-04-18 Thread Jan Hubicka
What is the reason why lowering for SJLJ exceptions is not done in GIMPLE? Because it completely wrecks loops because we factor the SJLJ site, thus fn () { ... for (;;) { try { X } catch { Y } } becomes fn () { if (setjmp ()) { switch (...)

Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-04-18 Thread Richard Henderson
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.