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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So there is some jump threading happening which is causing
__perf_cpu_map__nr(orig) and __perf_cpu_map__nr(other) to be thought as less
than 0. And then converting a negative number from signed to unsigned it
becomes a big unsigned integer.

Adding:

 if (__perf_cpu_map__nr(orig) < 0)
   __builtin_unreachable();
 if (__perf_cpu_map__nr(other) < 0)
   __builtin_unreachable();

Right before  `tmp_len = __perf_cpu_map__nr(orig) + __perf_cpu_map__nr(other);`
fixes the warning.

I have not looked yet why there is jump threading happening in GCC 13 and not
14.

Reply via email to