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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Works for me on the trunk:

I almost want to say this was fixed by PR 101373.

Before Pre we had:
  if (hash_6(D) == 0)
    goto <bb 3>; [0.00%]
  else
    goto <bb 4>; [100.00%]

  <bb 3> [count: 0]:
  rb_check_type.isra (0);
  goto <bb 6>; [0.00%]

  <bb 4> [local count: 1073741824]:
  _1 = (long int *) hash_6(D);
  _2 = *_1;
  if (_2 != 0)
    goto <bb 5>; [0.00%]
  else
    goto <bb 6>; [100.00%]

  <bb 5> [count: 0]:
  rb_check_type.isra (hash_6(D));

  <bb 6> [local count: 1073741824]:
  _3 = (long int *) hash_6(D);
  _4 = *_3;

Pre is able to figure that _3 and _1 are the same and even *_3 and *_1 would be
the same except rb_check_type.isra (hash_6(D)) can do a noreturn depending on
the argument even though it is a "pure" function otherwise.

Reply via email to