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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |15.0
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-07-01
             Status|UNCONFIRMED                 |NEW
             Target|X86_64                      |x86_64-*-*

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I can confirm that we do not thread the jumps.  Note that the optimization
only happens on RTL (by jump-after-combine).  On GIMPLE the 2 byte and
4 byte memcmp are inline expanded, but we are not able to thread

  <bb 2> :
  _1 = __builtin_memcmp (input_5(D), "ab", 2);
  if (_1 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 3>; [INV]

  <bb 3> :
  _2 = __builtin_memcmp (input_5(D), "abcd", 4);
  if (_2 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :

  <bb 5> :
  # iftmp.1_3 = PHI <1(3), 0(4), 1(2)>

since we do not have "string ranges".  I'm not sure if strlenopt would have
enough infrastructure to thread this or if it is even worth the trouble.

Reply via email to