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
- Compile fpc.exe -OWDEVIRTCALLS -FWwpo.wpo demo_project.pas
- Run demo_project.exe -> you see output "Hello world!"
- Then compile fpc.exe -OwDEVIRTCALLS -Fwwpo.wpo demo_project.pas
- 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