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  <marc.gli...@inria.fr>

     PR tree-optimization/57361
gcc/
     * tree-ssa-dse.c (dse_possible_dead_store_p): Handle self-assignment.

gcc/testsuite/
     * gcc.dg/tree-ssa/pr57361.c: New file.
So dse_optimize_stmt will verify the statement does not have volatile operands. However, it doesn't verify the statement does not potentially throw (think about a segfault on the store when async exceptions are enabled). I think you need to test for that explicitly.


Is there some reason this won't work in tree-ssa-dce.c? That gets run more often and these stores may be preventing code motion opportunities, so getting them out of the IL stream as early as possible would be good.

I'd be curious how often this triggers in GCC itself as well.

jeff

Reply via email to