[Bug tree-optimization/122996] Missed optimisation for branch folding with unsigned arithmetic wraparound
mital at mitalashok dot co.uk
gcc-bugzilla@gcc.gnu.org
Thu Dec 4 07:39:06 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122996
--- Comment #4 from Mital Ashok <mital at mitalashok dot co.uk> ---
(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);
}
More information about the Gcc-bugs
mailing list