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: What is ccp_fold_builtin() for vs. fold_builtin_1() ?


On Thu, Mar 31, 2005 at 05:46:40PM -0500, Kaveh R. Ghazi wrote:

> And what is the place of fold_builtin_1() given we have
> ccp_fold_builtin() ?
> 
> Would someone please enlighten me?
> 
ccp_fold_builtin was mostly an attempt to enhance CCP so that we
could propagate constant string attributes from non constant
values.  It uses a rudimentary use-def chain walker that will do
simple things like:

if (random ())
  s_1 = "xxx";
else
  s_2 = "yyy";
s_3 = PHI <s_1, s_2>
return strlen (s_3);

Even if the value of s_3 is non-constant, we know that
strlen(s_3) is always 3.

The implementation is very crude and primitive.  A better
propagator that was able to handle other attributes could now be
implemented using the SSA propagation engine.

Interested?  I never got around to fixing this wart.


Diego.


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