http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53219
--- Comment #1 from Martin Husemann <martin at netbsd dot org> 2012-05-03 21:34:13 UTC --- It occured to me that gcc would (rightfully) behave this way, if the (previous) value in %i0 should be considered dead at this point - which might be the case, hard to tell due to lots of macro magic [is there some way to easily check this?]. However, in this function there is a sigsetjmp() call, and in the test case we return to it. The standard says that non volatile automatic variables which values changed after the setjmp() call may have the later value on return from the longjmp - and this probably extrapolates to this type of register usage. Since %i0 is not callee saved in sparc64, its value is restored on longjmp from the register window shadow copy on the stack, where it has the later value (0 in the exammple). So, how could I check this hypothesis? Is there some attribute magic we could use to hint gcc to keep all values alive at the setjmp call alive untill the end of the function?