From e2872c9aea0cf94b49805203476aa852b4bfd20a Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 9 Sep 2006 22:10:32 +0000 Subject: [PATCH] * fixed more missing subsetreg/subsetref support git-svn-id: trunk@4595 - --- .gitattributes | 1 + compiler/x86/nx86cnv.pas | 7 +++++++ compiler/x86/nx86mat.pas | 6 +++++- tests/webtbs/tw7379.pp | 9 +++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw7379.pp diff --git a/.gitattributes b/.gitattributes index 00dd82effc..a5d00d9df5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7287,6 +7287,7 @@ tests/webtbs/tw7195.pp svneol=native#text/plain tests/webtbs/tw7227.pp svneol=native#text/plain tests/webtbs/tw7276.pp svneol=native#text/plain tests/webtbs/tw7372.pp svneol=native#text/plain +tests/webtbs/tw7379.pp svneol=native#text/plain tests/webtbs/ub1873.pp svneol=native#text/plain tests/webtbs/ub1883.pp svneol=native#text/plain tests/webtbs/uw0555.pp svneol=native#text/plain diff --git a/compiler/x86/nx86cnv.pas b/compiler/x86/nx86cnv.pas index cc4793de71..4d449fb3db 100644 --- a/compiler/x86/nx86cnv.pas +++ b/compiler/x86/nx86cnv.pas @@ -121,6 +121,10 @@ implementation { Load left node into flag F_NE/F_E } resflags:=F_NE; + + if (left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF]) then + location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true); + case left.location.loc of LOC_CREFERENCE, LOC_REFERENCE : @@ -222,6 +226,9 @@ implementation location_reset(location,LOC_MMREGISTER,def_cgsize(resulttype.def)); location.register:=cg.getmmregister(current_asmdata.CurrAsmList,def_cgsize(resulttype.def)); + if (left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF]) then + location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true); + case torddef(left.resulttype.def).typ of u64bit: begin diff --git a/compiler/x86/nx86mat.pas b/compiler/x86/nx86mat.pas index 062e6264c7..b8e9e2664e 100644 --- a/compiler/x86/nx86mat.pas +++ b/compiler/x86/nx86mat.pas @@ -263,7 +263,11 @@ interface LOC_REGISTER, LOC_CREGISTER, LOC_REFERENCE, - LOC_CREFERENCE : + LOC_CREFERENCE, + LOC_SUBSETREG, + LOC_CSUBSETREG, + LOC_SUBSETREF, + LOC_CSUBSETREF : begin location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,true); emit_reg_reg(A_TEST,TCGSize2Opsize[opsize],left.location.register,left.location.register); diff --git a/tests/webtbs/tw7379.pp b/tests/webtbs/tw7379.pp new file mode 100644 index 0000000000..7b3de07d46 --- /dev/null +++ b/tests/webtbs/tw7379.pp @@ -0,0 +1,9 @@ +{$mode macpas} + +program test; +var x: packed array [1..8] of boolean; +begin x[1]:= false; x[1]:= not x[1]; +if (not x[1]) then + halt(1); +end. +