mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:29:14 +02:00
* Proper fix for SPARC cycling with -dCHECK_PIC, pi_needs_got additionally must be set in following cases:
1) tguidconstnode.pass_1 (location is LOC_CREFERENCE) 2) tonnode.pass_1 (generic secondpass references VMT of exception class) 3) Conversion from unsigned to floating-point involves 'magic constant' as GOT-relative data object. 4) Case jumptable address is loaded relative to GOT. (1) and (2) also provide more accurate setting of pi_needs_got for all targets. git-svn-id: trunk@23188 -
This commit is contained in:
parent
658968ef44
commit
c766c50907
@ -1313,6 +1313,9 @@ implementation
|
|||||||
begin
|
begin
|
||||||
result:=nil;
|
result:=nil;
|
||||||
expectloc:=LOC_CREFERENCE;
|
expectloc:=LOC_CREFERENCE;
|
||||||
|
if (cs_create_pic in current_settings.moduleswitches) and
|
||||||
|
(tf_pic_uses_got in target_info.flags) then
|
||||||
|
include(current_procinfo.flags,pi_needs_got);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function tguidconstnode.docompare(p: tnode): boolean;
|
function tguidconstnode.docompare(p: tnode): boolean;
|
||||||
|
@ -2136,6 +2136,11 @@ implementation
|
|||||||
begin
|
begin
|
||||||
result:=nil;
|
result:=nil;
|
||||||
include(current_procinfo.flags,pi_do_call);
|
include(current_procinfo.flags,pi_do_call);
|
||||||
|
{ Loads exception class VMT, therefore may need GOT
|
||||||
|
(generic code only; descendants may need to avoid this check) }
|
||||||
|
if (cs_create_pic in current_settings.moduleswitches) and
|
||||||
|
(tf_pic_uses_got in target_info.flags) then
|
||||||
|
include(current_procinfo.flags,pi_needs_got);
|
||||||
expectloc:=LOC_VOID;
|
expectloc:=LOC_VOID;
|
||||||
if assigned(left) then
|
if assigned(left) then
|
||||||
firstpass(left);
|
firstpass(left);
|
||||||
|
@ -87,7 +87,12 @@ implementation
|
|||||||
if is_signed(left.resultdef) then
|
if is_signed(left.resultdef) then
|
||||||
inserttypeconv(left,s32inttype)
|
inserttypeconv(left,s32inttype)
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
inserttypeconv(left,u32inttype);
|
inserttypeconv(left,u32inttype);
|
||||||
|
if (cs_create_pic in current_settings.moduleswitches) and
|
||||||
|
(tf_pic_uses_got in target_info.flags) then
|
||||||
|
include(current_procinfo.flags,pi_needs_got);
|
||||||
|
end;
|
||||||
firstpass(left);
|
firstpass(left);
|
||||||
end;
|
end;
|
||||||
result := nil;
|
result := nil;
|
||||||
|
@ -27,6 +27,7 @@ unit ncpuset;
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
globtype,
|
globtype,
|
||||||
|
node,
|
||||||
nset,
|
nset,
|
||||||
ncgset;
|
ncgset;
|
||||||
|
|
||||||
@ -36,6 +37,8 @@ unit ncpuset;
|
|||||||
procedure optimizevalues(var max_linear_list:aint;var max_dist:aword);override;
|
procedure optimizevalues(var max_linear_list:aint;var max_dist:aword);override;
|
||||||
function has_jumptable : boolean;override;
|
function has_jumptable : boolean;override;
|
||||||
procedure genjumptable(hp : pcaselabel;min_,max_ : aint);override;
|
procedure genjumptable(hp : pcaselabel;min_,max_ : aint);override;
|
||||||
|
public
|
||||||
|
function pass_1:tnode;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -62,6 +65,16 @@ unit ncpuset;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tcpucasenode.pass_1:tnode;
|
||||||
|
begin
|
||||||
|
result:=inherited pass_1;
|
||||||
|
{ TODO: ABI-compliant position-independent case code does not involve GOT }
|
||||||
|
if (cs_create_pic in current_settings.moduleswitches) and
|
||||||
|
(tf_pic_uses_got in target_info.flags) then
|
||||||
|
include(current_procinfo.flags,pi_needs_got);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tcpucasenode.genjumptable(hp : pcaselabel;min_,max_ : aint);
|
procedure tcpucasenode.genjumptable(hp : pcaselabel;min_,max_ : aint);
|
||||||
var
|
var
|
||||||
table : tasmlabel;
|
table : tasmlabel;
|
||||||
|
Loading…
Reference in New Issue
Block a user