mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 20:09:25 +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
|
||||
result:=nil;
|
||||
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;
|
||||
|
||||
function tguidconstnode.docompare(p: tnode): boolean;
|
||||
|
@ -2136,6 +2136,11 @@ implementation
|
||||
begin
|
||||
result:=nil;
|
||||
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;
|
||||
if assigned(left) then
|
||||
firstpass(left);
|
||||
|
@ -87,7 +87,12 @@ implementation
|
||||
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) and
|
||||
(tf_pic_uses_got in target_info.flags) then
|
||||
include(current_procinfo.flags,pi_needs_got);
|
||||
end;
|
||||
firstpass(left);
|
||||
end;
|
||||
result := nil;
|
||||
|
@ -27,6 +27,7 @@ unit ncpuset;
|
||||
|
||||
uses
|
||||
globtype,
|
||||
node,
|
||||
nset,
|
||||
ncgset;
|
||||
|
||||
@ -36,6 +37,8 @@ unit ncpuset;
|
||||
procedure optimizevalues(var max_linear_list:aint;var max_dist:aword);override;
|
||||
function has_jumptable : boolean;override;
|
||||
procedure genjumptable(hp : pcaselabel;min_,max_ : aint);override;
|
||||
public
|
||||
function pass_1:tnode;override;
|
||||
end;
|
||||
|
||||
|
||||
@ -62,6 +65,16 @@ unit ncpuset;
|
||||
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);
|
||||
var
|
||||
table : tasmlabel;
|
||||
|
Loading…
Reference in New Issue
Block a user