Okay, thanks. Attached is a proper regression test.

--
Aaron Landwehr

On Tue, Aug 2, 2011 at 2:09 PM, John McCall <[email protected]> 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.
>
// RUN: %clang_cc1 -triple s390x-unknown-linux -emit-llvm -w -o - < %s | FileCheck %s
void bar();

void foo() {
// CHECK: call void @bar()
  bar(1);
}

void bar() {
}

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

Reply via email to