|
@@ -300,6 +300,8 @@ interface
|
|
|
function jvm_full_typename(with_package_name: boolean): string;
|
|
|
{ check if the symtable contains a float field }
|
|
|
function contains_float_field : boolean;
|
|
|
+ { check if the symtable contains a field that spans an aword boundary }
|
|
|
+ function contains_cross_aword_field: boolean;
|
|
|
end;
|
|
|
|
|
|
pvariantrecdesc = ^tvariantrecdesc;
|
|
@@ -2114,12 +2116,14 @@ implementation
|
|
|
recsize:=size;
|
|
|
is_intregable:=
|
|
|
ispowerof2(recsize,temp) and
|
|
|
- (((recsize <= sizeof(aint)*2) and
|
|
|
+ not trecorddef(self).contains_cross_aword_field and
|
|
|
+ ((recsize<=sizeof(aint)*2) and
|
|
|
{ records cannot go into registers on 16 bit targets for now }
|
|
|
- (sizeof(aint)>2) and
|
|
|
- not trecorddef(self).contains_float_field) or
|
|
|
- (recsize <= sizeof(aint))) and
|
|
|
- not needs_inittable;
|
|
|
+ (sizeof(aint)>2) and
|
|
|
+ (not trecorddef(self).contains_float_field) or
|
|
|
+ (recsize <= sizeof(aint))
|
|
|
+ ) and
|
|
|
+ not needs_inittable;
|
|
|
{$endif llvm}
|
|
|
end;
|
|
|
end;
|
|
@@ -4253,6 +4257,41 @@ implementation
|
|
|
end;
|
|
|
|
|
|
|
|
|
+ function tabstractrecorddef.contains_cross_aword_field: boolean;
|
|
|
+ var
|
|
|
+ i : longint;
|
|
|
+ foffset, fsize: aword;
|
|
|
+ begin
|
|
|
+ result:=true;
|
|
|
+ for i:=0 to symtable.symlist.count-1 do
|
|
|
+ begin
|
|
|
+ if (tsym(symtable.symlist[i]).typ<>fieldvarsym) or
|
|
|
+ (sp_static in tsym(symtable.symlist[i]).symoptions) then
|
|
|
+ continue;
|
|
|
+ if assigned(tfieldvarsym(symtable.symlist[i]).vardef) then
|
|
|
+ begin
|
|
|
+ if is_packed then
|
|
|
+ begin
|
|
|
+ foffset:=tfieldvarsym(symtable.symlist[i]).fieldoffset;
|
|
|
+ fsize:=tfieldvarsym(symtable.symlist[i]).vardef.packedbitsize;
|
|
|
+ end
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ foffset:=tfieldvarsym(symtable.symlist[i]).fieldoffset*8;
|
|
|
+ fsize:=tfieldvarsym(symtable.symlist[i]).vardef.size*8;
|
|
|
+ end;
|
|
|
+ if (foffset div (sizeof(aword)*8)) <> ((foffset+fsize-1) div (sizeof(aword)*8)) then
|
|
|
+ exit;
|
|
|
+ { search recursively }
|
|
|
+ if (tstoreddef(tfieldvarsym(symtable.symlist[i]).vardef).typ=recorddef) and
|
|
|
+ (tabstractrecorddef(tfieldvarsym(symtable.symlist[i]).vardef).contains_cross_aword_field) then
|
|
|
+ exit;
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+ result:=false;
|
|
|
+ end;
|
|
|
+
|
|
|
+
|
|
|
{***************************************************************************
|
|
|
trecorddef
|
|
|
***************************************************************************}
|