[LLVMbugs] [Bug 4400] New: Structure Alignment in MSVC
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Tue Jun 16 06:24:31 PDT 2009
http://llvm.org/bugs/show_bug.cgi?id=4400
Summary: Structure Alignment in MSVC
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Windows XP
Status: NEW
Keywords: portability
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: manoel at fonetica.com.br
CC: llvmbugs at cs.uiuc.edu
In Windows plataform with MSVC:
target datalayout =
"p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:1-f80:32:32"
%FIRSTSTRU = type { i32, double, i32, i8* }
If I define a strucutre like %FIRSTSTRU and a function like :
define i32 @STRUFUN(%FIRSTSTRU* %OUTRASTRU) {
entry:
ret i32 1
}
in the C side I do
struct xfirstStru
{
int var1;
double var2;
int var3;
char *var4;
};
typedef struct xfirstStru osX ;
typedef osX* PosX ;
PosX xf = (PosX) malloc( sizeof(osX) );
char *paux = (char*) malloc( 256 );
strcpy(paux,"teste C - LLVM");
memset(xf,0,sizeof(osX));
and we call the LLVM function from the C function,
fp_StruFun(xf);
the fields , from the double one, are not at the expected position.
--
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