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 tom_devr...@mentor.com wrote: On 27/04/12 11:01, Richard Guenther wrote: SNIP I see you do not handle SNIP struct S { int i; }; struct S foo (void); struct S bar (void) { struct S s1, s2; if

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 tom_devr...@mentor.com wrote: On 27/04/12 11:01, Richard Guenther wrote: SNIP I see you do not handle SNIP struct S { int i; }; struct S foo (void); struct S bar (void) {   struct S s1, s2;   if (...)    s = foo ();   else    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: SNIP I see you do not handle SNIP 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 LHS that is not an SSA name. Indeed, the gvn patch

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

2012-04-27 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 tom_devr...@mentor.com wrote: On 25/04/12 11:57, Richard Guenther wrote: SNIP Hmm. I'm not sure we can conclude that they have the same value! +int bar (int); +void baz (int); +void bla (int); +

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 tom_devr...@mentor.com wrote: On 26/04/12 12:20, Richard Guenther wrote: On Wed, Apr 25, 2012 at 11:56 PM, Tom de Vries tom_devr...@mentor.com wrote: On 25/04/12 11:57, Richard Guenther wrote: SNIP Hmm.  I'm not sure we can conclude that they

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 tom_devr...@mentor.com wrote: On 25/04/12 11:57, Richard Guenther wrote: SNIP 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;

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 tom_devr...@mentor.com wrote: On 17/04/12 14:24, Richard Guenther wrote: On Sat, Apr 14, 2012 at 9:26 AM, Tom de Vries tom_devr...@mentor.com wrote: On 27/01/12 21:37, Tom de Vries wrote: On 24/01/12 11:40, Richard Guenther wrote: On Mon, Jan 23,

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 (); } ok ... outside

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() { if (bar(true) ==

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: SNIP 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) +{ + bla (5); + a = bar (7); +} +

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 tom_devr...@mentor.com 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 tom_devr...@mentor.com wrote: Richard,

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 tom_devr...@mentor.com 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 tom_devr...@mentor.com wrote: Richard, Jakub, the following patch fixes PR51879.

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 tom_devr...@mentor.com wrote: Richard, Jakub, the following patch fixes PR51879. Consider the following test-case: ... int bar (int); void baz (int); void

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 tom_devr...@mentor.com 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)

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 tom_devr...@mentor.com 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

[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