<div>Hi all,</div><div><br></div><div>I am submitting a patch for CodeGenModule.cpp:ReplaceUsesOfNonProtoTypeWithRealFunction(). There exists a defect in the implementation where the attribute list of the original call instruction is copied over without modification to the new call instruction. In cases where extra arguments are passed, this means that the arguments are dropped, but the attributes for those arguments persist.</div>


<div><br></div><div>This can result in the following assertion error occurring in the back-end when verifying the CS via Verifier.cpp:VerifyCallSite().</div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>Attributes after last parameter!</div><div>  call void @bar()</div></div><div><br></div></blockquote>The attached err.c file is one such error case.  However, as far as I can tell, this is only reproducible on targets that promote integer types to 64 bit. This is because the integer parameter at the call site has an added sext attribute and then later the parameter is removed, but the attribute for the parameter is kept. <div>

<br></div><div> SystemZ is one such case. Running the following command using trunk llvm/clang will reproduce the error:<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div>"clang -ccc-host-triple s390x-unknown-linux err.c"</div></blockquote><div><br></div>Thanks,<br><div><div><div><div><div><div><div>--<br>Aaron Myles Landwehr <img src="https://mail.google.com/mail/e/1E3"><br>


Graduate Student<br>Computer Architecture and Parallel Systems Laboratory (CAPSL)<br>Dupont 322<br>
University Of Delaware<br><a href="tel:302-831-1257" value="+13028311257" target="_blank">302-831-1257</a> (Office Phone)<br>
</div></div></div></div></div></div></div>
</div>