This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix ICE in expand_cse_reciprocals (PR tree-optimization/42078)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]