[comp.sys.amiga.programmer] GCC trashing A5 reg

tll@nntp-server.caltech.edu (Tal Lewis Lancaster) (03/08/91)

I have a program compiled under SAS/C.  It starts up several iterations of a 
child process using the 2.0 function System().  The child program was 
compiled under gcc.  The first iteration comes back fine.  But when the second
comes back,  the A5 register is corrupted.  And then a few statements 
later GURU, 80000004 (or 81000004, don't remeber).

This is the only know problem with these programs (the parents stack space is 
getting messed up).  If I manually change the A5 register, at the end of each
iteration, back to the correct value, the probram behaves.

Does anybody have any theories?  Oh, by the way let's make a silly assumption 
that my code is ok.  Is there a problem with mixing compilers like this?  Is
gcc doing bad housecleaning?