[LLVMbugs] [Bug 5406] New: Invalid call lowering on ARM

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Nov 5 18:19:29 PST 2009


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

           Summary: Invalid call lowering on ARM
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: rafael.espindola at gmail.com
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu


In the C code

-------------
typedef struct { char x[3]; } A0;
void foo (int i, ...);
int main (void)
{
  A0 a3;
  a3.x[0] = 0;
  a3.x[0] = 0;
  a3.x[2] = 26;
  foo (1,  a3 );
  return 0;
}
------------

The call is lowered by llvm-gcc to

 tail call arm_aapcscc  void (i32, ...)* @foo(i32 11, i16 0, i8 26) nounwind

Which is incorrect. All of a3 should be passed in R1 and the above call splits
it in R1 and R2.

clang produces correct code:

  %tmp11 = insertvalue [1 x i32] undef, i32 1703936, 0 ; <[1 x i32]> [#uses=1]
  %tmp12 = insertvalue %0 undef, [1 x i32] %tmp11, 0 ; <%0> [#uses=1]
  tail call arm_aapcscc  void (i32, ...)* @foo(i32 1, %0 %tmp12) nounwind

Note that 1703936 is 0x1a0000 which is 26 with two 0 bytes added.


-- 
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