Re: [RFC] 4.7 backport crashes (was: Re: Tree tail merging breaks __builtin_unreachable optimization)

2012-07-16 Thread Richard Guenther
On Mon, Jul 16, 2012 at 3:55 PM, Ulrich Weigand wrote: > Richard Guenther wrote: >> On Fri, Jul 6, 2012 at 6:36 PM, Tom de Vries wrote: >> > Bootstrapped and reg-tested (ada inclusive) on x86_64. >> > >> > OK for trunk? >> >> Ok. >> Thanks, >> Richard. >> >> > 2012-07-06 Tom de Vries >> >

[RFC] 4.7 backport crashes (was: Re: Tree tail merging breaks __builtin_unreachable optimization)

2012-07-16 Thread Ulrich Weigand
Richard Guenther wrote: > On Fri, Jul 6, 2012 at 6:36 PM, Tom de Vries wrote: > > Bootstrapped and reg-tested (ada inclusive) on x86_64. > > > > OK for trunk? > > Ok. > Thanks, > Richard. > > > 2012-07-06 Tom de Vries > > Richard Guenther > > > > * tree-ssa-ccp.c (optimi

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-09 Thread Ulrich Weigand
Tom de Vries wrote: > 2012-07-06 Tom de Vries > Richard Guenther > > * tree-ssa-ccp.c (optimize_unreachable): New function. > (execute_fold_all_builtins): Use optimize_unreachable to optimize > BUILT_IN_UNREACHABLE. Don't optimize after BUILT_IN_UNREACHABLE. > >

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-09 Thread Richard Guenther
On Fri, Jul 6, 2012 at 6:36 PM, Tom de Vries wrote: > On 06/07/12 13:01, Richard Guenther wrote: >> On Thu, Jul 5, 2012 at 8:45 PM, Tom de Vries wrote: >>> On 05/07/12 15:30, Michael Matz wrote: Hi, On Thu, 5 Jul 2012, Tom de Vries wrote: > The asserts allow the return res

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-06 Thread Tom de Vries
On 06/07/12 13:01, Richard Guenther wrote: > On Thu, Jul 5, 2012 at 8:45 PM, Tom de Vries wrote: >> On 05/07/12 15:30, Michael Matz wrote: >>> Hi, >>> >>> On Thu, 5 Jul 2012, Tom de Vries wrote: >>> The asserts allow the return result to be optimized, but not the cfg conditions. >>>

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-06 Thread Richard Guenther
On Thu, Jul 5, 2012 at 8:45 PM, Tom de Vries wrote: > On 05/07/12 15:30, Michael Matz wrote: >> Hi, >> >> On Thu, 5 Jul 2012, Tom de Vries wrote: >> >>> The asserts allow the return result to be optimized, but not the cfg >>> conditions. >>> >>> AFAIU, we can insert the asserts earlier. F.i., we c

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-05 Thread Tom de Vries
On 05/07/12 15:30, Michael Matz wrote: > Hi, > > On Thu, 5 Jul 2012, Tom de Vries wrote: > >> The asserts allow the return result to be optimized, but not the cfg >> conditions. >> >> AFAIU, we can insert the asserts earlier. F.i., we can insert >> aD.1711_6 = ASSERT_EXPR 0> >> before the GIM

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-05 Thread Michael Matz
Hi, On Thu, 5 Jul 2012, Tom de Vries wrote: > The asserts allow the return result to be optimized, but not the cfg > conditions. > > AFAIU, we can insert the asserts earlier. F.i., we can insert > aD.1711_6 = ASSERT_EXPR 0> > before the GIMPLE_COND in bb2. Nope. That would require some mor

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-05 Thread Richard Guenther
On Thu, Jul 5, 2012 at 2:49 PM, Tom de Vries wrote: > On 04/07/12 19:02, Ulrich Weigand wrote: >> Any suggestions how to fix this? Should tail merging detect >> __builtin_unreachable and not merge such block? Or else, should >> the CFG optimizer be extended (how?) to handle unreachable blocks >>

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-05 Thread Michael Matz
Hi, On Thu, 5 Jul 2012, Richard Guenther wrote: > >> On Wed, Jul 4, 2012 at 7:02 PM, Ulrich Weigand > >> wrote: > >> > Any suggestions how to fix this? Should tail merging detect > >> > __builtin_unreachable and not merge such block? > >> > >> That seems to be the most straight-forward thing

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-05 Thread Tom de Vries
On 04/07/12 19:02, Ulrich Weigand wrote: > Any suggestions how to fix this? Should tail merging detect > __builtin_unreachable and not merge such block? Or else, should > the CFG optimizer be extended (how?) to handle unreachable blocks > with multiple predecessors better? Ulrich, I extended th

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-05 Thread Richard Guenther
On Thu, Jul 5, 2012 at 2:44 PM, Michael Matz wrote: > Hi, > > On Wed, 4 Jul 2012, Steven Bosscher wrote: > >> On Wed, Jul 4, 2012 at 7:02 PM, Ulrich Weigand wrote: >> > Any suggestions how to fix this? Should tail merging detect >> > __builtin_unreachable and not merge such block? >> >> That see

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-05 Thread Michael Matz
Hi, On Wed, 4 Jul 2012, Steven Bosscher wrote: > On Wed, Jul 4, 2012 at 7:02 PM, Ulrich Weigand wrote: > > Any suggestions how to fix this? Should tail merging detect > > __builtin_unreachable and not merge such block? > > That seems to be the most straight-forward thing to do. I don't think >

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-04 Thread Steven Bosscher
On Wed, Jul 4, 2012 at 7:02 PM, Ulrich Weigand wrote: > Any suggestions how to fix this? Should tail merging detect > __builtin_unreachable and not merge such block? That seems to be the most straight-forward thing to do. I don't think there are any other passes that do this kind of code merging

Re: Tree tail merging breaks __builtin_unreachable optimization

2012-07-04 Thread Andrew Pinski
On Wed, Jul 4, 2012 at 10:02 AM, Ulrich Weigand wrote: > Any suggestions how to fix this?  Should tail merging detect > __builtin_unreachable and not merge such block?  Or else, should > the CFG optimizer be extended (how?) to handle unreachable blocks > with multiple predecessors better? This bu