Frank Heckenbach wrote:
<snip>
BTW, are the bugs reproducible in C code?
I don't have a C version of fproc.pas, but I tried the C code from a previous discussion instead:
extern int puts (const char *); extern void abort (void);
int main (void) { __label__ l1;
void foo (void) {
void bar (void) { puts ("goto l1"); goto l1; } bar ();
}
foo (); abort (); l1: puts ("label l1"); return 0; }
The results on Mac OS X are incorrect, both with gcc-3.2.x and gcc-3.3. So, I reported this to the gcc gnats bug database. The reply was prompt:
Andrew Pinski wrote:
In 3.4 (do not know about 3.3): It looks like the register that is holding the pic address is overwritten in bar so when the jump happens the pic register now holds the pic for bar, not for main so it prints out some garbage. It looks like it should save and restore it in r30 like stack register is. A workaround in 3.4 for applications is to use -mdynamic-no-pic which will get rid of the pic code.
This makes me confident that it will be fixed (or at least that we are making progress).
Regards,
Adriaan van Os