* 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); 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;

View File

@ -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;