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 tree-opt/22037, ICE not renaming a VOP


On Wed, Jul 13, 2005 at 12:10:56PM -0600, Jeffrey A Law wrote:
> On Mon, 2005-07-04 at 06:37 -0400, Andrew Pinski wrote:
>
> > Testcase:
> > extern double sqrt (double);
> > 
> > void foo(double *d, int n)
> > {
> >    double e=0;
> >    for(int i=0; i<n; i++);
> >    for(int i=0; i<n; i++) e=1;
> >    *d = sqrt(e);
> > 
> >    for(int i=0; i<n; i++);
> > } 
> Your patch for this looks way too conservative -- shouldn't
> you only prevent propagation of constants into uses of virtual
> operands?
> 
What's happening here is that a constant gets propagated into an
expression that had virtual operands (sqrt(e)), but after folding
the operands, the expression ends up with no virtual operands.

So we end up needing to update the SSA form in places we didn't
expect (CFG cleanup).

The alternative would be to have CFG cleanup call update SSA, but
it seems a high price to pay.  I don't think we should be doing
propagation inside CFG cleanup, anyway.  We have good propagators
in the right place.


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