Recent

Author Topic: Bug in FPC optimization (aoptx86.pas)  (Read 803 times)

noname01

  • New Member
  • *
  • Posts: 10
Bug in FPC optimization (aoptx86.pas)
« on: August 16, 2023, 09:46:12 am »
Hi,
I'm sorry but I don't have a gitlab account,
so I report a bug I found in this commit of FPC Source:

https://gitlab.com/freepascal.org/fpc/source/-/commit/4d33e5f137bce78e1d14a02cee370fd42e6adebe

The optimization with -O3 produces a bad output of my file test.pp.
Attached you find the file test.pp you so you can reproduce the bug.
Thanks in advance.

E:\lazarus\fpc\bin\x86_64-win64>fpc -O2 E:\test.pp
Free Pascal Compiler version 3.3.1 [2023/08/15] for x86_64
Copyright (c) 1993-2023 by Florian Klaempfl and others
Target OS: Win64 for x64
Compiling E:\test.pp
Linking E:\test.exe
69 lines compiled, 0.1 sec, 34336 bytes code, 1604 bytes data

E:\lazarus\fpc\bin\x86_64-win64>E:\test.exe
186059610

E:\lazarus\fpc\bin\x86_64-win64>fpc -O3 E:\test.pp
Free Pascal Compiler version 3.3.1 [2023/08/15] for x86_64
Copyright (c) 1993-2023 by Florian Klaempfl and others
Target OS: Win64 for x64
Compiling E:\test.pp
Linking E:\test.exe
69 lines compiled, 0.1 sec, 34320 bytes code, 1604 bytes data

E:\lazarus\fpc\bin\x86_64-win64>E:\test.exe
206031441
Error: the correct value is 186059610

« Last Edit: August 16, 2023, 09:52:24 am by noname01 »

AlexTP

  • Hero Member
  • *****
  • Posts: 2519
    • UVviewsoft

 

TinyPortal © 2005-2018