* 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:
sergei 2013-06-08 23:29:50 +00:00
parent 5fe8b516d4
commit 86637a9ff9
2 changed files with 13 additions and 7 deletions

View File

@ -129,10 +129,14 @@ implementation
procedure TMIPSProcInfo.allocate_got_register(list:tasmlist);
begin
if (cs_create_pic in current_settings.moduleswitches) and
(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);
if (cs_create_pic in current_settings.moduleswitches) then
begin
if (pi_do_call in flags) then
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;

View File

@ -71,8 +71,6 @@ uses
*****************************************************************************}
function tmipseltypeconvnode.first_int_to_real: tnode;
var
fname: string[19];
begin
{ converting a 64bit integer to a float requires a helper }
if is_64bitint(left.resultdef) or
@ -87,7 +85,11 @@ begin
if is_signed(left.resultdef) then
inserttypeconv(left,s32inttype)
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);
end;
result := nil;