View Issue Details

IDProjectCategoryView StatusLast Update
0032127FPCCompilerpublic2019-09-03 16:32
ReporterMax NazhalovAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformWin32OSOS Version
Product Version3.1.1Product Buildr36313 
Target VersionFixed in Version 
Summary0032127: [msdos] ie2014032801 in rare cases when inlining in COMPACT memory model
DescriptionReduced example attached: inlining codepointer conversion (near->far) triggers IE in this memory model.
Steps To Reproducefpc -Pi8086 -Tmsdos -WmCompact ie2014032801-compact.pp
Tagsinternal error
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files
  • ie2014032801-compact.pp (891 bytes)
    {$mode objfpc}
    {$inline on}
    program ie2014032801; // MSDOS compact memory model
    
    // fpc -Pi8086 -Tmsdos -WmCompact ie2014032801-compact.pp 
    
    {$ifndef FPC_MM_COMPACT}
      {$warning COMPACT mmodel expected!}
    {$endif}
    
    function cast_ptr( p: pointer {far} ): dword; //inline;
    begin
    {$PUSH}{$WARN 4055 OFF} // Conversion between ordinals and pointers is not portable
      result := dword(p);
    {$POP}
    end;
    
    function cast_ptr( p: codepointer {near} ): dword; inline; // this inline triggers ie2014032801
    begin
    {$PUSH}{$WARN 4055 OFF} // Conversion between ordinals and pointers is not portable
      result := dword(ptr(CSeg,ofs(p^)));
    {$POP}
    end;
    
    function gen_test( src, dst: dword ): boolean;
    begin
      result :=(src=dst);
    end;
    
    procedure test( src: codepointer; dst: pointer ); //inline;
    begin
      gen_test(cast_ptr(src),cast_ptr(dst));
    end;
    
    begin
      test(nil,nil);
    end.
    

Activities

Max Nazhalov

2017-07-08 15:42

reporter  

ie2014032801-compact.pp (891 bytes)
{$mode objfpc}
{$inline on}
program ie2014032801; // MSDOS compact memory model

// fpc -Pi8086 -Tmsdos -WmCompact ie2014032801-compact.pp 

{$ifndef FPC_MM_COMPACT}
  {$warning COMPACT mmodel expected!}
{$endif}

function cast_ptr( p: pointer {far} ): dword; //inline;
begin
{$PUSH}{$WARN 4055 OFF} // Conversion between ordinals and pointers is not portable
  result := dword(p);
{$POP}
end;

function cast_ptr( p: codepointer {near} ): dword; inline; // this inline triggers ie2014032801
begin
{$PUSH}{$WARN 4055 OFF} // Conversion between ordinals and pointers is not portable
  result := dword(ptr(CSeg,ofs(p^)));
{$POP}
end;

function gen_test( src, dst: dword ): boolean;
begin
  result :=(src=dst);
end;

procedure test( src: codepointer; dst: pointer ); //inline;
begin
  gen_test(cast_ptr(src),cast_ptr(dst));
end;

begin
  test(nil,nil);
end.

Max Nazhalov

2019-09-03 16:31

reporter   ~0117938

Last edited: 2019-09-03 16:32

View 2 revisions

Seems been fixed meanwhile..

Issue History

Date Modified Username Field Change
2017-07-08 15:42 Max Nazhalov New Issue
2017-07-08 15:42 Max Nazhalov File Added: ie2014032801-compact.pp
2017-07-08 15:44 Max Nazhalov Tag Attached: internal error
2019-09-03 16:31 Max Nazhalov Note Added: 0117938
2019-09-03 16:32 Max Nazhalov Note Edited: 0117938 View Revisions