As far as I can see your reasoning leading to
the compiler would see no trouble in moving the memcpy
call
is correct. Your question is not answered by the language definition, and can only be addressed with reference to specific compilers.
Sorry to not have any more-useful information.