https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66313

--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Right now .optimized looks like this:

f6 (int a, int b)
{
  int _2; 
  int _4; 
  int _5; 

  <bb 2>: 
  _2 = a_1(D) * 3;
  _4 = _2 - b_3(D);
  _5 = _4 * 2;
  return _5; 

}

whereas if we compute the expression in unsigned, we generate this:

f6 (int a, int b)
{
  int _2; 
  unsigned int _3; 
  unsigned int b.5_5;
  unsigned int _6; 
  unsigned int _7; 
  int _8; 

  <bb 2>: 
  _2 = a_1(D) * -3; 
  _3 = (unsigned int) _2; 
  b.5_5 = (unsigned int) b_4(D);
  _6 = _3 + b.5_5;
  _7 = _6 * 4294967294;
  _8 = (int) _7; 
  return _8; 

}

But I see no other way ;(.

Reply via email to