This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa-branch] Optimizing non-SIMPLE trees
- From: Richard Henderson <rth at redhat dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 9 Aug 2002 15:57:21 -0700
- Subject: Re: [tree-ssa-branch] Optimizing non-SIMPLE trees
- References: <20020809140937.GA20231@tornado.toronto.redhat.com>
On Fri, Aug 09, 2002 at 10:09:37AM -0400, Diego Novillo wrote:
> The simplifier refuses to simplify the call to strncmp() because
> it contains at least one constant argument. It does this to
> avoid tricking the code generator into not outputting a builtin
> call when all the arguments are constant.
This is bogus.
> Clearly, the simplifier could be a bit smarter in this case, but
> the point remains that we will many times refuse to simplify a
> builtin or other special trees. The question is now, how do we
> tell the optimizers to keep their hands off these trees?
No, this is not clear. You'd be complicating the optimizers for
no reason whatsoever.
The correct solution here is to expand builtin functions *after*
constant propagation. Then we get nice builtin expansion when
the user hasn't written something convenient up front.
Of course afterwards you get to re-do the propagation, since we
may well have generated new constants.