This is the mail archive of the gcc@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: [tree-ssa] CCP and non-destructive folding problems


On Tue, 2003-02-25 at 11:23, law at redhat dot com wrote:
> In message <1046189535 dot 1695 dot 11 dot camel at shadowfax>, Diego Novillo writes:
>  >On Tue, 2003-02-25 at 11:10, law at redhat dot com wrote:
>  >> In message <20030225155039 dot GB746 at tornado dot toronto dot redhat dot com>, Diego Novillo
>  > 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.  Ditto builtins.  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.

> 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.

Or, if as you point out, the two variants of fold can't really be made
to share more code, we will then have to bite the bullet and go down the
rathole anyway.


Diego.


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