http://llvm.org/bugs/show_bug.cgi?id=11018

           Summary: ARM byval is actually by reference
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: ARM
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


The attached byval_is_ref.ll demonstrates how byval is actually passed by
reference in this case. Modifying the parameter in the callee affects the value
in the caller. The return value of main is 55 instead of 0.

Compile with:

$ llc -march=arm -mtriple=armv7a-none-linux-gnueabi byval_is_ref.ll

The reason for this behavior:

CCValAssign::isRegLoc() returns true for the byval argument. In
ARMTargetLowering::LowerCall(), this causes a pointer to the struct be passed,
instead of following the IsByVal case.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to