Internal error 200305057 when compiling Laz fpspreadsheet project with -O2
Original Reporter info from Mantis: BigChimp
-
Reporter name: Reinier Olislagers
Original Reporter info from Mantis: BigChimp
- Reporter name: Reinier Olislagers
Description:
Compiling a Lazarus project with fpspreadsheet, if I set Optimization to -O2 I get an internal error 200305057 on the last line below in fpolebasic.pas.
If -O1 or no optimization given, this error does not occur.
procedure TOLEStorage.WriteOLEFile(AFileName: string;
AOLEDocument: TOLEDocument; const AOverwriteExisting: Boolean;
const AStreamName: UTF8String);
...
OLEStream:=fsOLE.CreateStream(VLAbsolutePath,fmCreate);
// work around code for the bug 22370
tmpStream:=AOLEDocument.Stream;
tmpStream.Position:=0; //Ensures it is in the begining.
//previous code: AOLEDocument.Stream.Position:=0; //Ensures it is in the begining.
OLEStream.CopyFrom(AOLEDocument.Stream,AOLEDocument.Stream.Size);
Note:
- also occurs with FPC 2.6.1 (+Lazarus trunk)
- also occurs with FPC 2.6.0 (+Lazarus 1.0)
Steps to reproduce:
See sample Lazarus project. Build mode default has a working -O1, build mode fails_optimizationchanged has a failing -O2
Note: this error seems to depend on an existing compilation run.
Starting compilation with -O2 does not bring out the error; compiling with e.g. -O1 and then with the faulty -O2 does bring out the error.
Recompiling with -O2 then seems to go fine.
Recompiling with -O1 and then -O2 brings out the error again.
Perhaps something to do with the wrong .ppu files being picked up?
Additional information:
Relationship:
- bug with same error code when using fpspreadsheet: 22370: Serious FpOleBasic.pas error/bug (Fatal: Internal error 200305057)
- bug with same error code in 0021914 Internal error 200305057 when inlinig a method called via a constant address
Mantis conversion info:
- Mantis ID: 22869
- OS: Windows
- OS Build: Vista
- Build: r22378
- Platform: x64
- Version: 2.7.1
- Fixed in version: 2.6.1
- Fixed in revision: 22436 (#c9ff7925)