rjmccall added a comment. Can you find where that bitcast is being added? I know that different parts of IRGen are differently sensitive to types — it's possible that the return code is one of those more-permissive places. http://reviews.llvm.org/D14737