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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note we almost optimize out the testcase now to just:
  <bb 2> [local count: 1073741819]:
  typenum.0_1 = (unsigned int) typenum_4(D);
  _2 = typenum.0_1 + 34;
  if (_2 > 33)
    goto <bb 6>; [34.00%]
  else
    goto <bb 3>; [66.00%]

  <bb 3> [local count: 708669597]:
  _10 = (unsigned int) typenum_4(D);
  _5 = 4294967294 - _10;
  if (_5 <= 1)
    goto <bb 5>; [33.33%]
  else
    goto <bb 4>; [66.67%]

  <bb 4> [local count: 472446402]:

  <bb 5> [local count: 708669603]:
  # prephitmp_8 = PHI <105(4), 115(3)>

  <bb 6> [local count: 1073741824]:
  # _3 = PHI <0(2), prephitmp_8(5)>
  return _3;

Not the problem described here is fixed, just the testcase does not hit it any
more.
Note we currently produce much better code than even LLVM which still does:
        movl    $.L.str, %ecx
        cmpl    $32, %eax
        ja      .LBB0_3
# %bb.2:
        cltq
        movq    .Lswitch.table.main(,%rax,8), %rcx
.LBB0_3:
        movsbl  (%rcx), %eax

Reply via email to