On Tue, Mar 01, 2016 at 10:27:00AM +0100, Richard Biener wrote: > > We were thinking on making a function attribute that ensures that non > > necessary registers, or stack frames used by the function will be correctly > > cleared before returning. > > We think in implementing for x86_64 as a first work. > > For this we are trying to modify the epilogue generation. Here we should > > have the information of which registers this function used, and the size of > > the stack frame to clean. The downside of this is that will be architecture > > dependent. > > Do you think this is a good idea? Do you suggest something else? > > I think you can't avoid doing architecture specific changes here. > Note that on x86_64 you probably want to force > -maccumulate-outgoing-args > to avoid the use of push/pop and have the stack frame freeing fully in > the epilogue.
You'll also need to disable shrink-wrapping for that function. Segher