This is the mail archive of the
mailing list for the GCC project.
Re: Builtin expansion versus headers optimization: Reductions
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: OndÅej BÃlka <neleai at seznam dot cz>, gcc at gcc dot gnu dot org, law at redhat dot org, libc-alpha at sourceware dot org
- Date: Thu, 4 Jun 2015 14:33:19 +0200
- Subject: Re: Builtin expansion versus headers optimization: Reductions
- Authentication-results: sourceware.org; auth=none
- References: <20150604105929 dot GA19141 at domone> <alpine dot DEB dot 2 dot 10 dot 1506041206200 dot 31862 at digraph dot polyomino dot org dot uk>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Jun 04, 2015 at 12:26:03PM +0000, Joseph Myers wrote:
> > Again is this worth a gcc pass?
> This isn't a matter of compiler passes; it's additional checks in existing
> built-in function handling. Maybe that built-in function handling should
> move to the match-and-simplify infrastructure (some, for libm functions
> and bswap, already has) to make this even simpler to implement.
GCC already has a pass that attempts to track known and earlier computed
lengths of strings, and do various transformations and optimizations based
on that, see the tree-ssa-strlen.c pass. Most of that you really can't do
at the glibc headers level.