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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to