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

--- Comment #17 from Petr <kobalicek.petr at gmail dot com> ---
Guys thanks a lot for your feedback.

Is the may_alias annotation guaranteed to behave as expected in the future
versions of GCC too, or it's just too much UB that it's better to do unaligned
reads with memcpy?

What I like on my existing solution is that I can specify alignment, so for
example I can say that this 64-bit load is 4-byte aligned, and that hints a
compiler, I'm not sure how to hint that with memcpy. So far annotating the code
with may_alias works for me, it passes tests, but I'm kinda unsure whether this
is a good way to express unaligned memory access considering I have faced this
issue.

Reply via email to