This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Gimplification and simplification


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]