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)


On Thu, Nov 19, 2009 at 02:42:24PM +0100, Michael Matz wrote:
> 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.

Please read the patch Alex said, it doesn't leave the original expression in
the IL, but by not doing ugly hacks (and reusing the same SSA name for
something completely different is an ugly hack) you get all the needed debug
info updates for free.  I like Alex' patch, it is much nicer than what I
posted.

	Jakub


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