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: 26 Feb 2003 19:01:50 -0500
- Subject: Re: [tree-ssa] CCP and non-destructive folding problems
- References: <200302262332.h1QNWTeV028598@localhost.redhat.com>
On Wed, 2003-02-26 at 18:32, law at redhat dot com wrote:
> First, I'd rather not have the folders call into any of the simple
> routines. If we really really need to do this, then the code in
> question should probably move into tree-simple or somewhere other
> than fold(). I'd like to keep fold as independent of the simplifier
> as we can as a guiding principle.
>
OK. Good point.
> A closely related issue is whether we should consider arithmetic
> involving constant addresses as a simple operand. I think this
> is probably on your plate since I think it's something you want
> to do. I'm not convinced it's a good thing, but I'm not going to
> object if you make the changes to allow constant address arithmetic
> as simple operands.
>
It's only allowing ADDR_EXPR <VAR_DECL> (&var) as a simple constant.
Actually, now that you mention it, this may not be a good idea because
it would change the GIMPLE grammar. &var is a GIMPLE unary expression.
I withdraw this idea. Not good.
> A general note -- from looking at your patches it appeared that you were
> trying to get the two folders to always return the same results. That's
> not a particularly interesting thing to do.
>
> The (poorly named) nondestructive folder is used for constant discovery,
> and as a result stuff like simplifying var + 0 to var isn't really
> interesting.
>
Yes. I got caught by this. I see now that you had something else in
mind for the nd-folder. Maybe it would make sense to rename it or
simply document its intended use?
> I don't think it's worth the effort to check in your ENABLE_CHECKING
> stuff to verify the two folders produce the same constant results. The
> only places I see them differing is in address arithmetic. The
> differences between their results are not significant in terms of allowing
> us to find more constants.
>
OK. No problem.
Diego.