This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE in expand_cse_reciprocals (PR tree-optimization/42078)
- From: Michael Matz <matz at suse dot de>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Nov 2009 14:42:24 +0100 (CET)
- Subject: Re: [PATCH] Fix ICE in expand_cse_reciprocals (PR tree-optimization/42078)
- References: <20091118173010.GL3047@sunsite.ms.mff.cuni.cz> <ortywrgy8o.fsf@livre.localdomain>
Hi,
On Wed, 18 Nov 2009, Alexandre Oliva wrote:
> > The recent changes to execute_cse_reciprocals cause ICE on the
> > attached testcase. The problem is that the first loop over the imm
> > uses ignores debug stmts (which is correct, whether any debug stmts
> > reference arg1 or not shouldn't influence the decision on whether to
> > do the transformation or not), but the second loop assumes all imm
> > uses are assignments with RDIV_EXPR.
>
> IMHO, the problem is that arg1 is being reused to hold its own
> reciprocal. Should a different assignment of a newly-created SSA_NAME
> be created instead, debug bind stmts would be automagically fixed upon
> removal or replacement of the original assignment.
Nope, you don't want to leave in the original a/sqrt(b) expression, it
would result in slower code. Hence you want to do that transformation
only when you can replace all uses of the result, meaning that it's not
necessary to preserve the old SSA name, at which point it's useless
complexity to generate new instructions and a SSA name.
> Using a different SSA_NAME would also enable the transformation to be
> performed even when not all uses can be replaced.
This is exactly what you don't want.
Can we drop the debug statement please?
Ciao,
Michael.