Re: [patch RFA middle-end] Fix PR target/41993

2012-11-13 Thread Uros Bizjak
On Tue, Nov 13, 2012 at 6:09 PM, Jakub Jelinek wrote: >> int copy_start, copy_num; >> int j; >> >> - if (INSN_P (return_copy)) >> + if (INSN_P (return_copy) >> + && !DEBUG_INSN_P (return_copy)) > > Please use if (NONDEBUG_INSN_P

Re: [patch RFA middle-end] Fix PR target/41993

2012-11-13 Thread Jakub Jelinek
On Tue, Nov 13, 2012 at 06:07:20PM +0100, Uros Bizjak wrote: > @@ -242,7 +242,8 @@ create_pre_exit (int n_entities, int *entity_map, > int copy_start, copy_num; > int j; > > - if (INSN_P (return_copy)) > + if (INSN_P (return_copy) > +

Re: [patch RFA middle-end] Fix PR target/41993

2012-11-13 Thread Uros Bizjak
On Mon, Nov 12, 2012 at 9:40 AM, Eric Botcazou wrote: >> It looks to me, that we in fact want: >> >> --cut here-- >> Index: mode-switching.c >> === >> --- mode-switching.c(revision 193407) >> +++ mode-switching.c(working copy)

Re: [patch RFA middle-end] Fix PR target/41993

2012-11-12 Thread Eric Botcazou
> It looks to me, that we in fact want: > > --cut here-- > Index: mode-switching.c > === > --- mode-switching.c(revision 193407) > +++ mode-switching.c(working copy) > @@ -330,7 +330,7 @@ > short_bloc

Re: [patch RFA middle-end] Fix PR target/41993

2012-11-12 Thread Uros Bizjak
On Tue, Nov 6, 2012 at 9:12 AM, Eric Botcazou wrote: >> 2012-11-05 Uros Bizjak >> Kaz Kojima >> >> PR target/41993 >> * mode-switching.c (create_pre_exit): Set return_copy to >> last_insn when copy_start is a pseudo reg. It looks to me, that we in fact want: --cu

Re: [patch RFA middle-end] Fix PR target/41993

2012-11-06 Thread Uros Bizjak
On Mon, Nov 5, 2012 at 11:58 PM, Kaz Kojima wrote: > The attached patch is to solve PR target/41993 which will affect > targets using MODE_EXIT. > Without it, we can't find all return registers for __builtin_return > in mode-switching.c:create_pre_exit. See the trail #4 by Uros in > the PR for t

Re: [patch RFA middle-end] Fix PR target/41993

2012-11-06 Thread Kaz Kojima
Eric Botcazou wrote: > I was referring to the ret_start/reg_end/nregs business: why is it necessary? I thought that they are for the return value which requires multiple hard registers. Regards, kaz

Re: [patch RFA middle-end] Fix PR target/41993

2012-11-06 Thread Eric Botcazou
> Although I might be getting you wrong, the current code does a scan > based on those lines but builtin_return, functions with no return > value and exceptions require special treatments and made things > complex. I was referring to the ret_start/reg_end/nregs business: why is it necessary? --

Re: [patch RFA middle-end] Fix PR target/41993

2012-11-06 Thread Kaz Kojima
Eric Botcazou wrote: > OK, thanks. The number of special cases dealt with in the function is on the > verge of making it barely understandable though. Why couldn't a backward > scan > based only on: > > /* If the return register is not likely spilled, - as is >

Re: [patch RFA middle-end] Fix PR target/41993

2012-11-06 Thread Eric Botcazou
> 2012-11-05 Uros Bizjak > Kaz Kojima > > PR target/41993 > * mode-switching.c (create_pre_exit): Set return_copy to > last_insn when copy_start is a pseudo reg. OK, thanks. The number of special cases dealt with in the function is on the verge of making it bare

[patch RFA middle-end] Fix PR target/41993

2012-11-05 Thread Kaz Kojima
Hi, The attached patch is to solve PR target/41993 which will affect targets using MODE_EXIT. Without it, we can't find all return registers for __builtin_return in mode-switching.c:create_pre_exit. See the trail #4 by Uros in the PR for the details. The patch is tested with bootstrap and regtes