> tree-ssa-forwprop.c I presume?  That one misses calling fold_stmt when
> it propagates things.

Yep.
> 
> > <bb 5>:
> >  iftmp.1_9 = 0;
> >
> > <bb 6>:
> >  # iftmp.1_2 = PHI <1(4), 0(5)>
> >  D.2739_10 = __builtin_constant_p (iftmp.1_2);
> 
> But I wonder how it manages to do something to the above ... (are you
> sure it's forwprop?)

It is fwprop, but I cut&pasted wrong function (it is the offline copy instead 
of inline).
we transfrom:
g (unsigned int size)
{ 
  int iftmp.1;
  int D.2765;
  unsigned int D.2764;
  unsigned int D.2763;
  static unsigned int count[2] = {0, 0};
  int r;
  static unsigned int count[2] = {0, 0};
  unsigned int D.2729;

<bb 2>:
  D.2729_2 = size_1(D) / 4096;
  if (D.2729_2 > 1073741823)
    goto <bb 4>;
  else
    goto <bb 3>;

<bb 3>:

<bb 4>:
  # iftmp.1_7 = PHI <1(2), 0(3)>
  D.2765_8 = __builtin_constant_p (iftmp.1_7);

into:
g (unsigned int size)
{
  int D.2765;
  unsigned int D.2764;
  unsigned int D.2763;
  static unsigned int count[2] = {0, 0};
  int r;
  static unsigned int count[2] = {0, 0};

<bb 2>:
  D.2765_8 = __builtin_constant_p (0);

I guess forwprop should fold then...  The extra call and control flow survives
all the way down to ccp2 (that is after IPA) that eventually folds it away.

Honza

Reply via email to