We did a great job getting this wrong:
- We messed up which LLVM IR types to use for arguments and return values. The optimized libcalls use integer types for values.
Clang attempted to use the IR type which corresponds to the value passed in instead of using an appropriately sized integer type. This would result in violations of the ABI for, as an example, floating point types. - We didn't bother recording the result of the atomic libcall in the destination memory.
This fixes PR20780.
Hi David,
I've been chasing issues with libcxx for the xcore - hence finding this late in the day.
For non-optimized lib calls that return a value, don't we want to return the 'Res'?
viz:
if (!RetTy->isVoidType()) {
Have I understood the code correctly?
Robert