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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |easyhack

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Mital Ashok from comment #4)
> (In reply to Andrew Pinski from comment #2)
> > Do you have an full example to make sure the match pattern catches this?
> 
> <https://godbolt.org/z/Kq5rnoh7n>
> 
>     #include <string_view>
> 
>     std::string_view rtrim(std::string_view s, char c) {
>         auto last = s.find_last_not_of(c);
>         return s.substr(0, last == std::string_view::npos ? 0u : last + 1u);
>     }


Thanks,
And yes a match pattern like I did in comment #1 should fix this:
```
  if (last_5 != 18446744073709551615)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  iftmp.0_7 = last_5 + 1;

  <bb 4> :
  # iftmp.0_1 = PHI <iftmp.0_7(3), 0(2)>
```

Reply via email to