From d034215eaa3d649078b0f4956737a2e21a39cda9 Mon Sep 17 00:00:00 2001 From: sergei Date: Sat, 17 Jan 2015 11:30:19 +0000 Subject: * Fixed subscripting records of size OS_PAIR on big endian targets and enabled placing such records into registers. Tested and shows no regressions on mips-linux. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@29493 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/ncgmem.pas | 10 +++++----- compiler/symdef.pas | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/compiler/ncgmem.pas b/compiler/ncgmem.pas index 9072182c56..b80ae15208 100644 --- a/compiler/ncgmem.pas +++ b/compiler/ncgmem.pas @@ -446,14 +446,14 @@ implementation offsetcorrection:=0; if (left.location.size in [OS_PAIR,OS_SPAIR]) then begin - if (vs.fieldoffset>=sizeof(aword)) then - begin - location.sreg.subsetreg := left.location.registerhi; - offsetcorrection:=sizeof(aword)*8; - end + if (vs.fieldoffset>=sizeof(aword)) xor (target_info.endian=endian_big) then + location.sreg.subsetreg := left.location.registerhi else location.sreg.subsetreg := left.location.register; + if (vs.fieldoffset>=sizeof(aword)) then + offsetcorrection:=sizeof(aword)*8; + location.sreg.subsetregsize := OS_INT; end else diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 3795337b3f..c94ab0e5a5 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -2032,8 +2032,7 @@ implementation recsize:=size; is_intregable:= ispowerof2(recsize,temp) and - { sizeof(asizeint)*2 records in int registers is currently broken for endian_big targets } - (((recsize <= sizeof(asizeint)*2) and (target_info.endian=endian_little) + (((recsize <= sizeof(asizeint)*2) { records cannot go into registers on 16 bit targets for now } and (sizeof(asizeint)>2) and not trecorddef(self).contains_float_field) or -- cgit v1.2.1