[Bug libstdc++/121946] [missing optimization] std::vector does not use memcpy for the trivially copyable/destructible type
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Sep 15 04:31:32 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121946
--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> For the missing gimple/compiler optimization detection of memmove this is PR
> 99504 really.
> We have an aggregate copy which ldist does not support currently.
There is also
(compute_affine_dependence
ref_a: *__first_10, stmt_a: *__cur_11 = *__first_10;
ref_b: *__cur_11, stmt_b: *__cur_11 = *__first_10;
) -> dependence analysis failed
consider run-time aliasing test between *__first_10 and *__cur_11
If I make __is_bitwise_relocatable<int> false, we don't get memmove/memcpy for
foo_int either.
__is_bitwise_relocatable currently defaults to __is_trivial, I think there is
already an issue about replacing that with a weaker test, and with the
standardization of trivial relocation it is likely to change soon anyway. But
in the mean time, you can specialize __is_bitwise_relocatable for your type.
More information about the Gcc-bugs
mailing list