[LLVMbugs] [Bug 11018] New: ARM byval is actually by reference

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 26 18:01:00 PDT 2011


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: unassignedbugs at nondot.org
        ReportedBy: pdox at google.com
                CC: llvmbugs at cs.uiuc.edu


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.



More information about the llvm-bugs mailing list