On Sat, Oct 22, 2011 at 05:05:05AM -0400, David Miller wrote: > From: Jurij Smakov <jurij@xxxxxxxxx> > Date: Sat, 22 Oct 2011 10:00:24 +0100 > > > Is something conceptually wrong with just doing this: > > > > asm volatile ("save; flush; restore"); > > > > It fixes the problem for freebsd (will test on linux later today), and > > does not rely on compiler doing (or not doing) the "right" > > optimization. > > I would not do a "naked" save here, please just use the construct > I showed you with the %o7 register clobber. Yes, I missed that save is not allocating any memory, which is wrong. What I actually had in mind was this: asm volatile ("save %sp, -96, %sp; flushw; restore"); My concern with the approach you are proposing is that compiler may (in the future, perhaps) just optimize out the helper function, making arrangements to save %o7 in one of the unused registers, thus removing allocation of another register window and breaking it again. Best regards, -- Jurij Smakov jurij@xxxxxxxxx Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html