Re: [PATCH] Fix PR49642 in 4.6, questions about 4.7

2012-01-11 Thread William J. Schmidt
Thanks for all the help! I'll get this tested and committed to trunk today. On Wed, 2012-01-11 at 13:11 +0100, Jakub Jelinek wrote: > On Wed, Jan 11, 2012 at 10:57:28AM +0100, Richard Guenther wrote: > > > + tree fndecl; > > > + > > > + if (!is_gimple_call (stmt)) > > > +return; > > > + > >

Re: [PATCH] Fix PR49642 in 4.6, questions about 4.7

2012-01-11 Thread Jakub Jelinek
On Wed, Jan 11, 2012 at 10:57:28AM +0100, Richard Guenther wrote: > > +  tree fndecl; > > + > > +  if (!is_gimple_call (stmt)) > > +    return; > > + > > +  fndecl = gimple_call_fndecl (stmt); > > + > > +  if (fndecl > > +      && TREE_CODE (fndecl) == FUNCTION_DECL > > Not needed. > > > +      &

Re: [PATCH] Fix PR49642 in 4.6, questions about 4.7

2012-01-11 Thread Jan Hubicka
> Well, just for record, the final version of patch seems to make sense for me > ;) > Thanks! It is an interesting side corner to say at least. Of course one could craft an function with two builtin_constant_p calls and the asm statement that is not dominated by either of them but still always c

Re: [PATCH] Fix PR49642 in 4.6, questions about 4.7

2012-01-11 Thread Jan Hubicka
> I think it should be unconditionally restrict splitting (I suppose on the > trunk the __builtin_constant_p is optimized away already). > > Btw, this will also disqualify any point below > > if (__builtin_constant_p (...)) >{ > ... >} > > because after the if join all BBs are domi

Re: [PATCH] Fix PR49642 in 4.6, questions about 4.7

2012-01-11 Thread Richard Guenther
On Tue, Jan 10, 2012 at 11:15 PM, William J. Schmidt wrote: > On Tue, 2012-01-10 at 09:42 -0600, William J. Schmidt wrote: >> >> On Tue, 2012-01-10 at 14:53 +0100, Richard Guenther wrote: >> > >> > Btw, this will also disqualify any point below >> > >> >  if (__builtin_constant_p (...)) >> >    {

Re: [PATCH] Fix PR49642 in 4.6, questions about 4.7

2012-01-10 Thread William J. Schmidt
On Tue, 2012-01-10 at 09:42 -0600, William J. Schmidt wrote: > > On Tue, 2012-01-10 at 14:53 +0100, Richard Guenther wrote: > > > > Btw, this will also disqualify any point below > > > > if (__builtin_constant_p (...)) > >{ > > ... > >} > > > > because after the if join all BBs ar

Re: [PATCH] Fix PR49642 in 4.6, questions about 4.7

2012-01-10 Thread William J. Schmidt
On Tue, 2012-01-10 at 14:53 +0100, Richard Guenther wrote: > On Tue, Jan 10, 2012 at 2:43 PM, William J. Schmidt > wrote: > > Greetings, > > > > This patch follows Richard Guenther's suggestion of 2011-07-05 in > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49642 to fix the problem in > > gcc 4

Re: [PATCH] Fix PR49642 in 4.6, questions about 4.7

2012-01-10 Thread Richard Guenther
On Tue, Jan 10, 2012 at 2:43 PM, William J. Schmidt wrote: > Greetings, > > This patch follows Richard Guenther's suggestion of 2011-07-05 in > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49642 to fix the problem in > gcc 4.6.  It prevents choosing a function split point that is dominated > by a b

[PATCH] Fix PR49642 in 4.6, questions about 4.7

2012-01-10 Thread William J. Schmidt
Greetings, This patch follows Richard Guenther's suggestion of 2011-07-05 in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49642 to fix the problem in gcc 4.6. It prevents choosing a function split point that is dominated by a builtin call to __builtin_constant_p. The bug was marked fixed in 4.7 s