Skip to content

WPO Whole Program Optimization DEVIRTCALLS optimization - generate program that not working correctly

Summary

Using WPO DEVIRTCALLS optimization - generate program not working correctly

System Information

  • Operating system: Windows 11 x64 / Ubuntu 22.04 LTS x64
  • Processor architecture: x86-64, Intel
  • Compiler version: On Windows: 3.2.2, trunk, On Linux: 3.2.2
  • Device: Computer

Steps to reproduce

  1. Compile fpc.exe -OWDEVIRTCALLS -FWwpo.wpo demo_project.pas
  2. Run demo_project.exe -> you see output "Hello world!"
  3. Then compile fpc.exe -OwDEVIRTCALLS -Fwwpo.wpo demo_project.pas
  4. Run demo_project.exe-> you see blank line! (but must see "Hello world!")

Example Project

demo_project.pas

program demo_project;

uses DOM;

var
  doc: TXMLDocument;
  el: TDOMElement;

begin
  doc := TXMLDocument.Create;

  el := doc.CreateElement('Node');
  el.SetAttribute('Attribute', 'Hello world!');

  WriteLn(el.Attributes[0].NodeValue);

  doc.Free;

  ReadLn;
end.

What is the current bug behavior?

Output blank line

What is the expected (correct) behavior?

Output "Hello world!"

Edited by alligator
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information