This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

armclang and memcpy: Weird behavior

Just for info:

armclang optimizes memcpy() in a weird way (seen for ARMv7e-M), not respecting the order of access.

So a memcpy(RBAR, mputable,...) failes :(

Parents
  • Does any memcpy implementation care about the order in which it copies the data? On x64, for e.g., an implementation may enlist the help of xmm registers for copying in large chunks. The function has to correctly deal with overlapping src and dst areas, but it isn't usually expected to deal directly with memory ordering. It does not know, just by looking at the src and dst address, the order in which it must copy. I think the assumption is that the function will be called to work on memory marked as Normal.

Reply
  • Does any memcpy implementation care about the order in which it copies the data? On x64, for e.g., an implementation may enlist the help of xmm registers for copying in large chunks. The function has to correctly deal with overlapping src and dst areas, but it isn't usually expected to deal directly with memory ordering. It does not know, just by looking at the src and dst address, the order in which it must copy. I think the assumption is that the function will be called to work on memory marked as Normal.

Children