View Issue Details

IDProjectCategoryView StatusLast Update
0036156FPCCompilerpublic2019-10-13 12:48
ReporterMartin FriebeAssigned ToJonas Maebe 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platform64bit IntelOSwin 10OS Version10
Product Version3.0.4Product Build 
Target VersionFixed in Version3.3.1 
Summary0036156: Wrong constant value with bitpacked Int64 on 32bit fpc
DescriptionTested with 3.0.4
Compile the below example

For 64bit result is correct

For 32bit (native or cross compiled) result is
9223372034707292159 // $7fffffff7fffffff the value is duplicated
2
Steps To Reproduceprogram Project1;
type
  TBitSize = -7..7;
  TFpDbgValueSize = bitpacked record
    Size: Int64;
    BitSize: TBitSize;
  end;

const
  gcFpDbgValueSize: TFpDbgValueSize = (Size: $7FFFFFFF; BitSize: 2);

begin
  writeln(gcFpDbgValueSize.Size);
  writeln(gcFpDbgValueSize.BitSize);
  readln;
end.
TagsNo tags attached.
Fixed in Revision43186
FPCOldBugId
FPCTarget-
Attached Files

Activities

Jonas Maebe

2019-10-13 12:48

manager   ~0118558

The broken x86 shifting logic strikes again...

Issue History

Date Modified Username Field Change
2019-10-09 14:23 Martin Friebe New Issue
2019-10-13 12:48 Jonas Maebe Assigned To => Jonas Maebe
2019-10-13 12:48 Jonas Maebe Status new => resolved
2019-10-13 12:48 Jonas Maebe Resolution open => fixed
2019-10-13 12:48 Jonas Maebe Fixed in Version => 3.3.1
2019-10-13 12:48 Jonas Maebe Fixed in Revision => 43186
2019-10-13 12:48 Jonas Maebe FPCTarget => -
2019-10-13 12:48 Jonas Maebe Note Added: 0118558