Actually something like this would work:
/*... */
ptr = alloca(4);
pushfl(ptr);
/*... */
popfl(ptr);
alloca(-4);
No, this is not a serious suggestion, but GCC can grok the stack pointer moving
while you are in the middle of a function. Believe it or not, some implementations of
alloca() do the right thing when given a negative argument :-).
-Eric