Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-07-06 Thread Richard Guenther
On Thu, Jul 5, 2012 at 6:44 PM, Tom de Vries wrote: > On 03/05/12 12:21, Richard Guenther wrote: >> On Wed, May 2, 2012 at 4:06 PM, Tom de Vries wrote: >>> On 27/04/12 11:01, Richard Guenther wrote: >>> I see you do not handle >>> struct S { int i; }; struct S foo (vo

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-07-05 Thread Tom de Vries
On 03/05/12 12:21, Richard Guenther wrote: > On Wed, May 2, 2012 at 4:06 PM, Tom de Vries wrote: >> On 27/04/12 11:01, Richard Guenther wrote: >> >>> I see you do not handle >> >>> struct S { int i; }; >>> struct S foo (void); >>> struct S bar (void) >>> { >>> struct S

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-05-03 Thread Richard Guenther
On Wed, May 2, 2012 at 4:06 PM, Tom de Vries wrote: > On 27/04/12 11:01, Richard Guenther wrote: > >> I see you do not handle > >> struct S { int i; }; >> struct S foo (void); >> struct S bar (void) >> { >>   struct S s1, s2; >>   if (...) >>    s = foo (); >>

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-05-02 Thread Tom de Vries
On 27/04/12 11:01, Richard Guenther wrote: > I see you do not handle > struct S { int i; }; > struct S foo (void); > struct S bar (void) > { > struct S s1, s2; > if (...) >s = foo (); > else >s = foo (); > > because the calls have a LH

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-27 Thread Richard Guenther
On Fri, Apr 27, 2012 at 8:20 AM, Tom de Vries wrote: > On 26/04/12 12:20, Richard Guenther wrote: >> On Wed, Apr 25, 2012 at 11:56 PM, Tom de Vries >> wrote: >>> On 25/04/12 11:57, Richard Guenther wrote: >>> Hmm.  I'm not sure we can conclude that they have the same value! >>

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-26 Thread Tom de Vries
On 26/04/12 12:20, Richard Guenther wrote: > On Wed, Apr 25, 2012 at 11:56 PM, Tom de Vries wrote: >> On 25/04/12 11:57, Richard Guenther wrote: >> >>> Hmm. I'm not sure we can conclude that they have the same value! >>> >>> +int bar (int); >>> +void baz (int); >>> +void bla

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-26 Thread Richard Guenther
On Wed, Apr 25, 2012 at 11:56 PM, Tom de Vries wrote: > On 25/04/12 11:57, Richard Guenther wrote: > >> Hmm.  I'm not sure we can conclude that they have the same value! >> >> +int bar (int); >> +void baz (int); >> +void bla (int); >> + >> +void >> +foo (in

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-25 Thread Tom de Vries
On 25/04/12 11:57, Richard Guenther wrote: >>> >> Hmm. I'm not sure we can conclude that they have the same value! >>> >> >>> >> +int bar (int); >>> >> +void baz (int); >>> >> +void bla (int); >>> >> + >>> >> +void >>> >> +foo (int y) >>> >> +{ >>> >> + int a; >>> >> + if (y == 6) >>> >> +{

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-25 Thread Tom de Vries
On 25/04/12 12:09, Jakub Jelinek wrote: > On Wed, Apr 25, 2012 at 11:57:09AM +0200, Richard Guenther wrote: >> void *foo () >> { >> return __builtin_return_address (0); >> } >> >> void *bar (_Bool b) >> { >> if (b) >> return foo (); >> else >> return foo (); >> } >> >> int main() >> {

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-25 Thread Jakub Jelinek
On Wed, Apr 25, 2012 at 11:57:09AM +0200, Richard Guenther wrote: > void *foo () > { > return __builtin_return_address (0); > } > > void *bar (_Bool b) > { > if (b) > return foo (); > else > return foo (); > } > > int main() > { > if (bar(true) == bar(false)) > abort (); > } >

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-25 Thread Richard Guenther
On Tue, Apr 24, 2012 at 11:19 PM, Tom de Vries wrote: > On 17/04/12 14:24, Richard Guenther wrote: >> On Sat, Apr 14, 2012 at 9:26 AM, Tom de Vries wrote: >>> On 27/01/12 21:37, Tom de Vries wrote: On 24/01/12 11:40, Richard Guenther wrote: > On Mon, Jan 23, 2012 at 10:27 PM, Tom de Vrie

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-24 Thread Tom de Vries
On 17/04/12 14:24, Richard Guenther wrote: > On Sat, Apr 14, 2012 at 9:26 AM, Tom de Vries wrote: >> On 27/01/12 21:37, Tom de Vries wrote: >>> On 24/01/12 11:40, Richard Guenther wrote: On Mon, Jan 23, 2012 at 10:27 PM, Tom de Vries wrote: > Richard, > Jakub, > > the f

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-17 Thread Richard Guenther
On Sat, Apr 14, 2012 at 9:26 AM, Tom de Vries wrote: > On 27/01/12 21:37, Tom de Vries wrote: >> On 24/01/12 11:40, Richard Guenther wrote: >>> On Mon, Jan 23, 2012 at 10:27 PM, Tom de Vries >>> wrote: Richard, Jakub, the following patch fixes PR51879. Consider the

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-04-14 Thread Tom de Vries
On 27/01/12 21:37, Tom de Vries wrote: > On 24/01/12 11:40, Richard Guenther wrote: >> On Mon, Jan 23, 2012 at 10:27 PM, Tom de Vries >> wrote: >>> Richard, >>> Jakub, >>> >>> the following patch fixes PR51879. >>> >>> Consider the following test-case: >>> ... >>> int bar (int); >>> void baz (int

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-01-27 Thread Tom de Vries
On 24/01/12 11:40, Richard Guenther wrote: > On Mon, Jan 23, 2012 at 10:27 PM, Tom de Vries wrote: >> Richard, >> Jakub, >> >> the following patch fixes PR51879. >> >> Consider the following test-case: >> ... >> int bar (int); >> void baz (int); >> >> void >> foo (int y) >> { >> int a; >> if (y

Re: [PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-01-24 Thread Richard Guenther
On Mon, Jan 23, 2012 at 10:27 PM, Tom de Vries wrote: > Richard, > Jakub, > > the following patch fixes PR51879. > > Consider the following test-case: > ... > int bar (int); > void baz (int); > > void > foo (int y) > { >  int a; >  if (y == 6) >    a = bar (7); >  else >    a = bar (7); >  baz (a)

[PATCH] Fix for PR51879 - Missed tail merging with non-const/pure calls

2012-01-23 Thread Tom de Vries
Richard, Jakub, the following patch fixes PR51879. Consider the following test-case: ... int bar (int); void baz (int); void foo (int y) { int a; if (y == 6) a = bar (7); else a = bar (7); baz (a); } ... after compiling at -02, the representation looks like this before tail-merg