This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Gimplification and simplification
- From: Diego Novillo <dnovillo at redhat dot com>
- To: "S. Bosscher" <S dot Bosscher at student dot tudelft dot nl>
- Cc: "'Jan Hubicka '" <jh at suse dot cz>, "'gcc at gcc dot gnu dot org '" <gcc at gcc dot gnu dot org>, "'Jeff Law '" <law at redhat dot com>
- Date: Wed, 05 Nov 2003 10:43:15 -0500
- Subject: RE: Gimplification and simplification
- Organization: Red Hat Canada
- References: <4195D82C2DB1D211B9910008C7C9B06F01F373D3@lr0nt3.lr.tudelft.nl>
On Wed, 2003-11-05 at 10:36, S. Bosscher wrote:
> What are you hunting for with this builtin work?
> Some of the string builtins are already fixed by Honza's
> earlier strrchr()-patch already seems to fix a bunch of
> string builtins.
>
Things like:
if (cond)
s = "yyy";
else
s = "xxx";
len = strlen (s);
The CCP machinery knows that even though 's' is non-constant at the
strlen() call, its length is constant. So we can fold that strlen to
'3'.
There are other. See tree-ssa-ccp.c:ccp_fold_builtin()
Diego.