Adriaan van Os wrote:
Waldek Hebisch wrote:
Adriaan van Os wrote:
The asmnames.pas failure is new. It doesn't fail with the gpc-20060215. Neither does it fail with gpc-20060325 at -O1. At -O3 or -O2 the output of the generated progam is empty. I can provide more info as needed.
Will take deeper look at asmnames.pas failure on Monday. ATM I would like to know if asmnames.pas fails also in non-pic mode?
Yes, that's what I already tried, it fails with -mdynamic-no-pic.
I still do not know what is wrong with asmnames.pas. I have tried to reproduce problem in ppc-linux, but in Linux asmnames.pas generated correct output. I am affraid it is time to do assembly level debugging. Could you set breakpoint in `puts' and look at its argument. The argument should be address of S plus 8, and it should point to the string "OK". The first question is if `puts' gets correct address (alternativly, the content of S my be incorrect).
If the content of S is incorrect then one may step trough the program to verify why. AFAICS generated assembly contains `memcpy' call and after that call data part of S should contain the string "OK". Next the length field (at address S plus 4) should be set to 2. Then there is a code to null terminate S (but only in conditionally, if it is not already null terminated). Then `puts' is called.
At first glance the assembly contains all needed instructions, but computers are much better then people at executing programs, so one should just single-step the program verifing values stored in S at each step.
BTW. One gets simplest assembly using `-static -fno-range-checking'.