This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] CCP and non-destructive folding problems
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: 25 Feb 2003 17:20:08 -0500
- Subject: Re: [tree-ssa] CCP and non-destructive folding problems
- References: <200302252051.h1PKptvI021626@localhost.redhat.com>
On Tue, 2003-02-25 at 15:51, law at redhat dot com wrote:
> My first checkin handles this correctly to. If an expression with
> constants doesn't fold, then it's VARYING. Yes we can miss some
> optimization opportunities, but they should be rare.
>
Well, we won't know until we measure.
> >(b) The non-destructive and destructive folders must always
> > return the same values. I've added a (moderately expensive)
> > check for this in the final fold pass.
> I don't think we'll want to check this code in as these checks
> are more for finding cases where we should improve the nondestructive
> folder as opposed to detecting hard bugs.
>
Could you leave it in exactly for that reason? If you want, predicate
it on #ifdef TREE_CHECKING and/or have it emit a warning instead of
abort().
> The other thing I'm thinking is that we need to rename the nondestructive
> folder. While it's true that it's a nondestructive folder, it's also a
> limited subset of folding, specifically it does nondestructive folding of
> expressions to constant values. If the expression does not simplify to
> a constant, then the folder returns NULL_TREE.
>
Yes. That's probably a good idea.
Diego.