[llvm-bugs] [Bug 27498] clang emits memcpy for std::swap, which can introduce undefined behavior
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Apr 24 08:25:10 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=27498
whitequark <whitequark at whitequark.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|DUPLICATE |---
--- Comment #2 from whitequark <whitequark at whitequark.org> ---
Sorry but I am reopening this. Specifically because the generated IR violates
LLVM's own invariats! To quote LangRef for @llvm.memcpy: "The ‘llvm.memcpy.*‘
intrinsics copy a block of memory from the source location to the destination
location, which are not allowed to overlap."
http://llvm.org/docs/LangRef.html#id407
It might be that the fix is adjusting the contract of @llvm.memcpy--it is not
my call. But I would say that the current self-contradictory behavior is
indefensible.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160424/67138173/attachment.html>
More information about the llvm-bugs
mailing list