[cfe-commits] [PATCH] Drop attributes for dropped parameters in ReplaceUsesOfNonProtoTypeWithRealFunction

Aaron Myles Landwehr snaphat at gmail.com
Tue Aug 2 11:56:24 PDT 2011

Okay, thanks. Attached is a proper regression test.

Aaron Landwehr

On Tue, Aug 2, 2011 at 2:09 PM, John McCall <rjmccall at apple.com> wrote:

> On Aug 2, 2011, at 10:47 AM, Aaron Myles Landwehr wrote:
> 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.
> This can result in the following assertion error occurring in the back-end
> when verifying the CS via Verifier.cpp:VerifyCallSite().
> Attributes after last parameter!
>   call void @bar()
> 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.
>  SystemZ is one such case. Running the following command using trunk
> llvm/clang will reproduce the error:
> "clang -ccc-host-triple s390x-unknown-linux err.c"
> This patch looks fine to me.  If you wouldn't mind turning err.c into a
> proper test case, I'd be happy to commit.
> I suggest modeling the test case after test/CodeGen/arm-pcs.c.
> John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110802/2fbbd40c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-non-prototype-call.c
Type: text/x-csrc
Size: 168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110802/2fbbd40c/attachment.c>

More information about the cfe-commits mailing list