mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:09:09 +02:00
* optimized ofs(proc) on i8086, so it only loads the offset in all memory models
git-svn-id: trunk@38682 -
This commit is contained in:
parent
c7503ca291
commit
58ead31f49
@ -69,14 +69,28 @@ implementation
|
||||
not is_proc_far(tabstractprocdef(left.resultdef)) then
|
||||
CGMessage1(type_e_procedure_must_be_far,left.resultdef.GetTypeName);
|
||||
Result:=inherited typecheck_proc_to_procvar;
|
||||
if tcnf_proc_2_procvar_get_offset_only in convnodeflags then
|
||||
begin
|
||||
if resultdef.typ<>procvardef then
|
||||
internalerror(2018040401);
|
||||
exclude(tprocvardef(resultdef).procoptions,po_far);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure t8086typeconvnode.second_proc_to_procvar;
|
||||
begin
|
||||
if is_proc_far(tabstractprocdef(resultdef))<>
|
||||
(current_settings.x86memorymodel in x86_far_code_models) then
|
||||
internalerror(2014041302);
|
||||
if tcnf_proc_2_procvar_get_offset_only in convnodeflags then
|
||||
begin
|
||||
if is_proc_far(tabstractprocdef(resultdef)) then
|
||||
internalerror(2018040402);
|
||||
end
|
||||
else
|
||||
begin
|
||||
if is_proc_far(tabstractprocdef(resultdef))<>
|
||||
(current_settings.x86memorymodel in x86_far_code_models) then
|
||||
internalerror(2014041302);
|
||||
end;
|
||||
if is_proc_far(tabstractprocdef(left.resultdef))<>
|
||||
(current_settings.x86memorymodel in x86_far_code_models) then
|
||||
internalerror(2014041303);
|
||||
|
@ -579,7 +579,10 @@ implementation
|
||||
begin
|
||||
if tabstractprocdef(left.resultdef).is_addressonly then
|
||||
begin
|
||||
result:=ctypeconvnode.create_internal(left,tabstractprocdef(left.resultdef).address_type);
|
||||
if anf_ofs in addrnodeflags then
|
||||
result:=ctypeconvnode.create_internal(left,tabstractprocdef(left.resultdef).ofs_address_type)
|
||||
else
|
||||
result:=ctypeconvnode.create_internal(left,tabstractprocdef(left.resultdef).address_type);
|
||||
include(result.flags,nf_load_procvar);
|
||||
left:=nil;
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user