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

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Quite impressive how we do the test in multiple ways, which are not quite
equivalent because of the wrapping semantics of unsigned. Maybe if we asserted
that the argument of operator new must be less than the size of the address
space / 2 after the call... Probably easier to tweak the C++ FE so it generates
more consistent comparisons (this would only remove 1 test).

  <bb 2> [local count: 118111601]:
  n.0_11 = (sizetype) n_10(D);
  _14 = operator new [] (n.0_11);
  _1 = n.0_11 + 18446744073709551615;
  _15 = (long int) _1;
  if (_15 < 0)
    goto <bb 3>; [11.00%]
  else
    goto <bb 4>; [89.00%]

  <bb 3> [local count: 118111600]:
  if (n_10(D) <= 0)
    goto <bb 6>; [11.00%]
  else
    goto <bb 5>; [89.00%]

  <bb 4> [local count: 105119325]:
  _31 = n.0_11 + 18446744073709551614;
  _26 = (long int) _31;
  _22 = _26 >= -1 ? n.0_11 : 1;
  __builtin_memset (_14, 0, _22);
  goto <bb 3>; [11.00%]

  <bb 5> [local count: 105119324]:
  __builtin_memset (_14, 255, n.0_11);

  <bb 6> [local count: 118111600]:
  return _14;

Reply via email to