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)
void bar();
void foo() { bar(1); }
void bar() { }

Attachment: CodeGenModule.diff
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to