mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 23:21:57 +02:00
* tcg.translate_register: check that reg.allocator is not nil before calling its method (in case of "assembler nostackframe" function returning an x87 float compiler tries to translate NR_ST which is used for function result).
* tcg.a_reg_dealloc: ignore NR_NO, prevents creating useless deallocations of NR_DEFAULTFLAGS on MIPS targets which have NR_DEFAULTFLAGS=NR_NO. git-svn-id: trunk@29242 -
This commit is contained in:
parent
fe49a4b60c
commit
8f4430e795
@ -815,8 +815,15 @@ implementation
|
||||
|
||||
|
||||
procedure tcg.translate_register(var reg : tregister);
|
||||
var
|
||||
rt: tregistertype;
|
||||
begin
|
||||
rg[getregtype(reg)].translate_register(reg);
|
||||
{ Getting here without assigned rg is possible for an "assembler nostackframe"
|
||||
function returning x87 float, compiler tries to translate NR_ST which is used for
|
||||
result. }
|
||||
rt:=getregtype(reg);
|
||||
if assigned(rg[rt]) then
|
||||
rg[rt].translate_register(reg);
|
||||
end;
|
||||
|
||||
|
||||
@ -828,7 +835,8 @@ implementation
|
||||
|
||||
procedure tcg.a_reg_dealloc(list : TAsmList;r : tregister);
|
||||
begin
|
||||
list.concat(tai_regalloc.dealloc(r,nil));
|
||||
if (r<>NR_NO) then
|
||||
list.concat(tai_regalloc.dealloc(r,nil));
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user