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

Aaron Myles Landwehr snaphat at gmail.com
Tue Aug 2 10:47:59 PDT 2011


Hi all,

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"


Thanks,
--
Aaron Myles Landwehr
Graduate Student
Computer Architecture and Parallel Systems Laboratory (CAPSL)
Dupont 322
University Of Delaware
302-831-1257 (Office Phone)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110802/0aee0536/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: err.c
Type: text/x-csrc
Size: 51 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110802/0aee0536/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CodeGenModule.diff
Type: application/octet-stream
Size: 1941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110802/0aee0536/attachment.obj>


More information about the cfe-commits mailing list