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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #6)
> Shouldn't this use __builtin_expect(!src_ptr, 0)? The FE is only supposed to
> call this function when we have a non-null pointer, which is true for
> programs with no UB, so this check potentially pessimizes correct programs.

It doesn't affect codegen, so GCC seems to guess correctly already. But it
might be worth adding it anyway, to be certain.

Reply via email to