Re: Remove self-assignments

2013-06-12 Thread Marc Glisse
On Wed, 12 Jun 2013, Richard Biener wrote: On Wed, Jun 12, 2013 at 10:47 AM, Marc Glisse wrote: Essentially never. I tried with the fold_stmt version of the patch, and libstdc++-v3/src/c++98/concept-inst.cc is the only file where it triggers. Note that the case: b=*a *a=b is already handled b

Re: Remove self-assignments

2013-06-12 Thread Jakub Jelinek
On Wed, Jun 12, 2013 at 09:42:55AM -0600, Jeff Law wrote: > On 06/12/13 02:03, Richard Biener wrote: > >DSE looks like the right place to me as we are removing a store. Yes, > >DCE removes a limited set of stores as well, but the way we remove this kind > >of store makes it much more suited to DSE

Re: Remove self-assignments

2013-06-12 Thread Jeff Law
On 06/11/13 13:30, Marc Glisse wrote: I'd be curious how often this triggers in GCC itself as well. Do you know a convenient way to test that? I usually put in some kind of debugging printfs during early development which I can then grep for in build logs. Not very sexy, but effective to

Re: Remove self-assignments

2013-06-12 Thread Jeff Law
On 06/12/13 02:03, Richard Biener wrote: DSE looks like the right place to me as we are removing a store. Yes, DCE removes a limited set of stores as well, but the way we remove this kind of store makes it much more suited to DSE. As of possibly trapping/throwing stores, we do not bother to pr

Re: Remove self-assignments

2013-06-12 Thread Richard Biener
On Wed, Jun 12, 2013 at 10:47 AM, Marc Glisse wrote: > On Wed, 12 Jun 2013, Richard Biener wrote: > >> On Tue, Jun 11, 2013 at 9:30 PM, Marc Glisse wrote: >>> >>> On Tue, 11 Jun 2013, Jeff Law wrote: >>> On 06/09/13 10:25, Marc Glisse wrote: > > > Hello, > > this patch re

Re: Remove self-assignments

2013-06-12 Thread Marc Glisse
On Wed, 12 Jun 2013, Richard Biener wrote: On Tue, Jun 11, 2013 at 9:30 PM, Marc Glisse wrote: On Tue, 11 Jun 2013, Jeff Law wrote: On 06/09/13 10:25, Marc Glisse wrote: Hello, this patch removes some self-assignments. I don't know if this is the best way, but it passes a bootstrap and th

Re: Remove self-assignments

2013-06-12 Thread Richard Biener
On Tue, Jun 11, 2013 at 9:30 PM, Marc Glisse wrote: > On Tue, 11 Jun 2013, Jeff Law wrote: > >> On 06/09/13 10:25, Marc Glisse wrote: >>> >>> Hello, >>> >>> this patch removes some self-assignments. I don't know if this is the >>> best way, but it passes a bootstrap and the testsuite on >>> x86_64

Re: Remove self-assignments

2013-06-11 Thread Marek Polacek
On Tue, Jun 11, 2013 at 09:30:29PM +0200, Marc Glisse wrote: > >I'd be curious how often this triggers in GCC itself as well. > > Do you know a convenient way to test that? Perhaps you could put in the if (gimple_assign_rhs_code (stmt) == TREE_CODE (gimple_assign_lhs (stmt)) && operand_equal

Re: Remove self-assignments

2013-06-11 Thread Marc Glisse
On Tue, 11 Jun 2013, Jeff Law wrote: On 06/09/13 10:25, Marc Glisse wrote: Hello, this patch removes some self-assignments. I don't know if this is the best way, but it passes a bootstrap and the testsuite on x86_64-linux-gnu. 2013-06-10 Marc Glisse PR tree-optimization/57361 gcc/

Re: Remove self-assignments

2013-06-11 Thread Jeff Law
On 06/09/13 10:25, Marc Glisse wrote: Hello, this patch removes some self-assignments. I don't know if this is the best way, but it passes a bootstrap and the testsuite on x86_64-linux-gnu. 2013-06-10 Marc Glisse PR tree-optimization/57361 gcc/ * tree-ssa-dse.c (dse_possible_dead_

Remove self-assignments

2013-06-09 Thread Marc Glisse
Hello, this patch removes some self-assignments. I don't know if this is the best way, but it passes a bootstrap and the testsuite on x86_64-linux-gnu. 2013-06-10 Marc Glisse PR tree-optimization/57361 gcc/ * tree-ssa-dse.c (dse_possible_dead_store_p): Handle self-assignmen