Recent

Author Topic: bugged compilation with the -Anasmwin32 option (FPC 3.2.2)  (Read 1394 times)

Avinash

  • New Member
  • *
  • Posts: 41
bugged compilation with the -Anasmwin32 option (FPC 3.2.2)
« on: June 05, 2021, 08:54:20 pm »
Code: Pascal  [Select][+][-]
  1. const A: Integer = 0;
  2.       B: Integer = 0;
  3.  
  4. begin
  5.   A := 1;
  6.   B := 222;
  7.   WriteLn(' Ofs = ', Ofs(B) - Ofs(A));
  8.   WriteLn('  A  = ', A);
  9.   WriteLn('  B  = ', B);
  10. end.

by default compilation (fpc filename) the program produces the correct result:

 Ofs = 16
  A  = 1 
  B  = 222


but compiling with the -Anasmwin32 option I got

  B  = 0 
  B  = 222
  B  = 222


It's about 3.2.2

FPC 3.0.4 with the -Anasmwin32 outputs the correct

 Ofs = 2 
  A  = 1 
  B  = 222

PascalDragon

  • Hero Member
  • *****
  • Posts: 3384
  • Compiler Developer
Re: bugged compilation with the -Anasmwin32 option (FPC 3.2.2)
« Reply #1 on: June 06, 2021, 08:37:30 pm »
Hmm, the assembly code at least looks correct on first glance... Please report a bug.

 

TinyPortal © 2005-2018