[parisc-linux] Using r2 for millicode return pointer
John Marvin
jsm@udlkern.fc.hp.com
Tue, 29 May 2001 22:50:46 -0600 (MDT)
Alan,
I am cc'ing parisc-linux also, since there are other parisc gcc experts
who may have an opinion on this. For those new to this, I found a
bug where a procedure calls millicode, which on Linux uses r2 as
a return pointer, however, gcc wasn't aware of that.
It looks like the cause of this bug is that we changed the return
pointer for millicode from r31 to r2. Was this a deliberate choice?
On HP-UX, millicode uses r31 for a return pointer. This allows leaf
routines to call millicode without having to save r2. I notice that the
code that you patched has a clobber for r31, which is not necessary
(currently) for Linux. Is this code shared with the HP-UX version of gcc?
If not, we should remove the r31 clobbers, since they are unecessary and
will allow more efficient usage for r31.
If this code is shared, perhaps that would be another motivation for
changing the Linux copy of the millicode to use r31, if possible (I
don't know what the motivation for using r2 was, so I don't know if
this is reasonable).
John
P.S. Thanks for the quick fix!