Re: [patch] PR 48837

2011-05-06 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/06/11 04:44, Zdenek Dvorak wrote: > Hi, > > when accumulator transformation is performed on a function like > > foo(a) > { > if (a > 0) > return 1 + foo (a - 1) > > return bla(); > } > > this becomes > > foo(a) > { > int tmp = 0; >

Re: [patch] PR 48837

2011-05-06 Thread Richard Guenther
On Fri, May 6, 2011 at 12:44 PM, Zdenek Dvorak wrote: > Hi, > > when accumulator transformation is performed on a function like > > foo(a) > { >  if (a > 0) >    return 1 + foo (a - 1) > >  return bla(); > } > > this becomes > > foo(a) > { >  int tmp = 0; > >  while (a > 0) >    tm = 1 + tmp; > >

[patch] PR 48837

2011-05-06 Thread Zdenek Dvorak
Hi, when accumulator transformation is performed on a function like foo(a) { if (a > 0) return 1 + foo (a - 1) return bla(); } this becomes foo(a) { int tmp = 0; while (a > 0) tm = 1 + tmp; return tmp + bla(); } Before, bla was a tail-call, but after the optimization, it i