This is the mail archive of the gcc-patches@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: [PATCH] fix pr39867, wrong folding to MAX_EXPR


> Doesn't the same problem exist with folding to min?

There is no special code to fold a >= 3 ? 2 : a (or a > 1 ? 2 : a) to
min(2, a), still all four of

int f(int a)
{
  return a >= 3 ? 2u : a;
}

int g(int a)
{
  return a > 1 ? 2u : a;
}

int h(int a)
{
  return a < 3 ? a : 2u;
}

int i(int a)
{
  return a <= 1 ? a : 2u;
}

are folded correctly to MIN_EXPR on int.

Paolo


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