On 12/01/2022 18:48, Sven Barth via fpc-devel wrote:
[2] From the users view "random", in that the user can not predict
all
the factors that will affect the selection.
Currently the user must be prepared for the latter.
No, it is deterministic, it's simply different from a native
x86_64-linux compilation or one from Win32 as mentioned above and that
is bad.
You completely missed the point.
I was NOT comparing Win vs Linux
I wrote
And this is not comparing the behaviour between the Linux and Windows
exe (both 64 bit). I agree that different behaviour must be expected.
This is the behaviour between compiling the same code, with the same
compiler, several times for the same target win-64.
Note the 2nd line.
- The exact same pascal code
- The exact same 32-bit ppcx64.exe
- the exact same target: Only compiling to 64-bit Windows exe
Changing only compiler options (e.g. optimizations), could possible
trigger a behavioural change in the resulting exe.
Because some calculation changed between being compiled to run-time or
compile-time.
=> ok, I have not deep enough insight into the optimizer, maybe
constant-propagation is 100% independent of any option passed to the
compiler.
Maybe constant-propagation will be the same at a levels of optimization....
But, also none functional changes such as
const c = extended(1.234567997807)
var a, b: extended;
begin
a := c;
...
b := c + a;
changed to
b:= c+c;
This is still the same code. There is no reason for a user to assume the
result should change.
But, depending on the code in between, I have seen cases were "c+a" was
done run-time.
While "c+c" should be compile time.
So, maybe it's not byte by byte the same pascal code. But from a
functional point of view, it is the same code.
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel