diff options
author | sergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2014-01-02 10:29:44 +0000 |
---|---|---|
committer | sergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2014-01-02 10:29:44 +0000 |
commit | ebe6d49c217c8550b3c94cc623e67568de021446 (patch) | |
tree | 4bf5a6ac3631c5f04578b6d723252752644067aa /compiler/ncgmat.pas | |
parent | 820abecb2966bf64675bb338125b427615f967c5 (diff) | |
download | fpc-ebe6d49c217c8550b3c94cc623e67568de021446.tar.gz |
* x86 and SPARC: fixed handling 64-bit (qwordbool) values in tcgnotnode (partial fix for Mantis #25255).
* Moved handling LOC_JUMP locations to helper method of base class, it appears to be the same for all targets.
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@26353 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ncgmat.pas')
-rw-r--r-- | compiler/ncgmat.pas | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/compiler/ncgmat.pas b/compiler/ncgmat.pas index a20fa4cc4c..30cba121e8 100644 --- a/compiler/ncgmat.pas +++ b/compiler/ncgmat.pas @@ -109,6 +109,7 @@ interface tcgnotnode = class(tnotnode) protected + function handle_locjump: boolean; procedure second_boolean;virtual;abstract; {$ifdef SUPPORT_MMX} procedure second_mmx;virtual;abstract; @@ -131,7 +132,7 @@ implementation parabase, pass_2, ncon, - tgobj,ncgutil,cgobj,cgutils,paramgr,hlcgobj + tgobj,ncgutil,cgobj,cgutils,paramgr,hlcgobj,procinfo {$ifndef cpu64bitalu} ,cg64f32 {$endif not cpu64bitalu} @@ -557,6 +558,33 @@ implementation end; + function tcgnotnode.handle_locjump: boolean; + var + hl: tasmlabel; + begin + result:=(left.expectloc=LOC_JUMP); + if result then + begin + hl:=current_procinfo.CurrTrueLabel; + current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel; + current_procinfo.CurrFalseLabel:=hl; + secondpass(left); + + if is_constboolnode(left) then + internalerror(2014010101); + if left.location.loc<>LOC_JUMP then + internalerror(2012081306); + + { This does nothing for LOC_JUMP } + //maketojumpbool(current_asmdata.CurrAsmList,left,lr_load_regvars); + hl:=current_procinfo.CurrTrueLabel; + current_procinfo.CurrTrueLabel:=current_procinfo.CurrFalseLabel; + current_procinfo.CurrFalseLabel:=hl; + location_reset(location,LOC_JUMP,OS_NO); + end; + end; + + procedure tcgnotnode.pass_generate_code; begin if is_boolean(resultdef) then |