http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60431

--- Comment #5 from Wojciech Migda <wojtek.golf at interia dot pl> ---
So, I'd like to learn some more from this. Suppose I have code like this:

int fn_i1(int x)
{
  x /= 2;
  return (x >= 0) ? x : -x;
}

or

short fn_s1(short x)
{
  return (x >= 0) ? x : -x;
}

In each case the compiler should know that the range of values being subjected
to *abs is such that it won't matter whether it will use the sign saturated
instruction or not. But it doesn't take advantage of that. Or I am still
getting it wrong?

Reply via email to