> > This patch broke Solaris bootstrap in stage 1 with g++ 4.9:
> > 
> > /vol/gcc/src/hg/trunk/solaris/gcc/ipa-cp.c: In member function 'bool 
> > ipcp_alignment_lattice::meet_with_1(unsigned int, unsigned int)':
> > /vol/gcc/src/hg/trunk/solaris/gcc/ipa-cp.c:855:56: error: call of 
> > overloaded 'abs(unsigned int)' is ambiguous
> >        int diff = abs (misalign - (new_misalign % align));
> 
> Calling abs on an unsigned type does not sound right anyway (that
> almost sounds like a good candidate for a warning).  I suppose the

Yep, I guess that may be a good idea ;)

> correct fix is to cast both subtraction operands to signed int, would
> such a change be pre-approved?

  if (misalign != (new_misalign % align))
    {
      int diff = abs (misalign - (new_misalign % align));
      align = MIN (align, (unsigned) diff & -diff);
      if (align)
        misalign = misalign % align;
      else
        set_to_bottom ();
      changed = true;
    }

So the logic here is that you compute differnce of missaligns and want to set 
align to be at least that.  Why
      align = MIN (align, (unsigned) diff & -diff);
I suppose ALIGN should be always greater than that, because diff is at most 
ALIGN.
So I suppose you want 
  align = (unsigned) diff & -diff

The changes are pre-approved.

honza

Reply via email to