[LLVMbugs] [Bug 13790] New: llvm mis-uses fp registers when the size of argument is bigger than 64 byte

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 7 04:18:58 PDT 2012


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

             Bug #: 13790
           Summary: llvm mis-uses fp registers when the size of argument
                    is bigger than 64 byte
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Backend: ARM
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jm.j.park at samsung.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9180
  --> http://llvm.org/bugs/attachment.cgi?id=9180
TestCase of GCC's ARM

When an argument, which is bigger than 64 byte and has double value, is passed
by va_list, llvm can't pass it correctly. 

This is a sample code. 

#include <stdio.h>

typedef struct _my_struct {
  double a;
  double b;
  double c;
  double d;
  double e;
  double f;
  double g;
  double h;
  double i;
} my_struct;

void
double_test(int n, ...)
{
  int i;
  va_list ap;
  my_struct val;
  va_start (ap, n);
  val = va_arg (ap, my_struct);
  va_end (ap);
  printf("val.a = %f\n", val.a);
}

int main()
{
  my_struct val = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  double_test(1, val);
}


In double_test, val.a should be 1, howerver, it is 0.

I doubt it might use fp registers incorrectly.

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