View Issue Details

IDProjectCategoryView StatusLast Update
0038164FPCCompilerpublic2020-12-17 23:09
ReporterBenjamin Rosseaux Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0038164: Int64 mod high Int64 Value generates wrong "exceeds 32-bit bound" ASM error at x86-64 target
DescriptionInt64 mod high Int64 Value generates wrong "exceeds 32-bit bound" ASM error at any x86-64 target

Example source:

program int64modint64bug;
{$mode delphi}
const
   a = int64($100000000);
 var
   b: int64 = 123;
   c: int64;
begin
  c := b mod a;
  if c <> 0 then
  begin
  end;
end.

Example output:

Free Pascal Compiler version 3.3.1 [2020/11/26] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Win64 for x64
Compiling int64modint64bug.pas
int64modint64bug.pas(11,10) Error: Asm: signed dword value exceeds bounds -4294967296
int64modint64bug.pas(15,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Steps To ReproduceCompile it for any x86-64 target with the internal assembler (without -Aas)
TagsNo tags attached.
Fixed in Revision47805
FPCOldBugId
FPCTarget-
Attached Files

Activities

Benjamin Rosseaux

2020-12-04 04:47

reporter  

int64modint64bug.pas (187 bytes)   
program int64modint64bug;
{$mode delphi}
const
   a = int64($100000000);

 var 
   b: int64 = 123;
   c: int64;

begin 
  c := b mod a;
  if c <> 0 then
  begin
  end; 
end.
int64modint64bug.pas (187 bytes)   
int64modint64bug.txt (371 bytes)   
Free Pascal Compiler version 3.3.1 [2020/11/26] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Win64 for x64
Compiling int64modint64bug.pas
int64modint64bug.pas(11,10) Error: Asm: signed dword value exceeds bounds -4294967296
int64modint64bug.pas(15,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
int64modint64bug.txt (371 bytes)   

Issue History

Date Modified Username Field Change
2020-12-04 04:47 Benjamin Rosseaux New Issue
2020-12-04 04:47 Benjamin Rosseaux File Added: int64modint64bug.pas
2020-12-04 04:47 Benjamin Rosseaux File Added: int64modint64bug.txt
2020-12-17 23:09 Florian Assigned To => Florian
2020-12-17 23:09 Florian Status new => resolved
2020-12-17 23:09 Florian Resolution open => fixed
2020-12-17 23:09 Florian Fixed in Version => 3.3.1
2020-12-17 23:09 Florian Fixed in Revision => 47805
2020-12-17 23:09 Florian FPCTarget => -