Subject: Re: ksh lossage on sparc64
To: None <>
From: Charles M. Hannum <>
List: tech-toolchain
Date: 11/21/2000 20:09:19
I believe this is a register window problem.  If I insert a `deeply'
nested call in a key place:

         bne,a,pn %icc, .LL368
         ld      [%i0+12], %o0
+        call    _g
+        nop
         ld      [%i0+16], %o0
         cmp     %o0, 0

to a set of functions that effectively do nothing:

void _a(void) {}
void _b(void) {_a();}
void _c(void) {_b();}      
void _d(void) {_c();}
void _e(void) {_d();}
void _f(void) {_e();}
void _g(void) {_f();} 

the problem disappears.  If I remove just one call in that chain (by
having it call _f() rather than _g()), the problem reappears.

This suggests that the sigreturn register window restore is failing,
but the call chain causes the windows to rotate and do an implicit
restore of the top window that we actually care about.

Definitely not a compiler or ksh bug.