[tree-ssa] CCP and non-destructive folding problems

law@redhat.com law@redhat.com
Tue Feb 25 16:57:00 GMT 2003


In message <1046190663.1695.24.camel@shadowfax>, Diego Novillo writes:
 >On Tue, 2003-02-25 at 11:23, law@redhat.com wrote:
 >> In message <1046189535.1695.11.camel@shadowfax>, Diego Novillo writes:
 >>  >On Tue, 2003-02-25 at 11:10, law@redhat.com wrote:
 >>  >> In message <20030225155039.GB746@tornado.toronto.redhat.com>, Diego Nov
 >illo
 >>  > wri
 >>  >> tes:
 >>  >>
 >>  >>  >How is it OK for the two versions of fold() to return different
 >>  >>  >values for the exact same expression?
 >>  >> As long as the return values will run-time evaluate to the same value,
 >>  >> then it is safe.  ie, it is safe for one to simplify an expression that
 >>  >> the other does not.
 >>  >> 
 >>  >But Jeff, as I mentioned in my previous post, if ccp_fold() is not able
 >>  >to fold an expression that is indeed CONSTANT, we will consider it
 >>  >VARYING and will then block further propagation (e.g., '1 && 1').  We
 >>  >must avoid that.
 >> Yes, and those should be rare.  Very very rare.
 >>
 >Not handling && was most certainly *not* rare. 
My mistake.  We'll fix it.


 > Ditto builtins.
I'm not so sure here.  The interaction between builtins and the tree-ssa
code is far from settled.

 > The
 >check didn't catch any other cases, but we are dying in stage2, so I
 >don't know if there are other cases missing.
We'll have to see.

 >
 >> If there are important cases missing, then we can add them, but the minute
 >> you start requiring that the two folders always give the same result
 >> you're going down a rathole.
 >> 
 >Well, that tells me we have a design problem in fold() then.  We really
 >need to have a nondestructive folder that behaves exactly the same as
 >the destructive one.  Otherwise, we'll make CCP do stupid things.
I really don't think we need this.  Look at fold.  Are you going to
try and duplicate all that work, but in a non-destructive way?  Please
come back to reality.   It would be a pointless exercise.

To write a non-destructive folder which always gets the same results you're
going to end up copying the expression, which is precisely what we do not
want to do.

Please, you're imposing requirements that don't make practical sense.

Jeff




More information about the Gcc mailing list