mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 23:29:13 +02:00
* MIPS: pi_needs_got is necessary when doing unsigned to float conversions (it uses a global constant) and also if procedure does any calls in PIC mode.
git-svn-id: trunk@24822 -
This commit is contained in:
parent
5fe8b516d4
commit
86637a9ff9
@ -129,10 +129,14 @@ implementation
|
|||||||
|
|
||||||
procedure TMIPSProcInfo.allocate_got_register(list:tasmlist);
|
procedure TMIPSProcInfo.allocate_got_register(list:tasmlist);
|
||||||
begin
|
begin
|
||||||
if (cs_create_pic in current_settings.moduleswitches) and
|
if (cs_create_pic in current_settings.moduleswitches) then
|
||||||
(pi_needs_got in flags) and
|
begin
|
||||||
not (po_nostackframe in procdef.procoptions) then
|
if (pi_do_call in flags) then
|
||||||
tg.gettemp(list,sizeof(aint),sizeof(aint),tt_noreuse,save_gp_ref);
|
include(flags,pi_needs_got);
|
||||||
|
if (pi_needs_got in flags) and
|
||||||
|
not (po_nostackframe in procdef.procoptions) then
|
||||||
|
tg.gettemp(list,sizeof(aint),sizeof(aint),tt_noreuse,save_gp_ref);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,8 +71,6 @@ uses
|
|||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
function tmipseltypeconvnode.first_int_to_real: tnode;
|
function tmipseltypeconvnode.first_int_to_real: tnode;
|
||||||
var
|
|
||||||
fname: string[19];
|
|
||||||
begin
|
begin
|
||||||
{ converting a 64bit integer to a float requires a helper }
|
{ converting a 64bit integer to a float requires a helper }
|
||||||
if is_64bitint(left.resultdef) or
|
if is_64bitint(left.resultdef) or
|
||||||
@ -87,7 +85,11 @@ begin
|
|||||||
if is_signed(left.resultdef) then
|
if is_signed(left.resultdef) then
|
||||||
inserttypeconv(left,s32inttype)
|
inserttypeconv(left,s32inttype)
|
||||||
else
|
else
|
||||||
inserttypeconv(left,u32inttype);
|
begin
|
||||||
|
inserttypeconv(left,u32inttype);
|
||||||
|
if (cs_create_pic in current_settings.moduleswitches) then
|
||||||
|
include(current_procinfo.flags,pi_needs_got);
|
||||||
|
end;
|
||||||
firstpass(left);
|
firstpass(left);
|
||||||
end;
|
end;
|
||||||
result := nil;
|
result := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user