This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

inline assembler modify esp



Hi all,

I was wondering if there was a way to let GCC know that the stack has been
modified by a certain amount (+4 bytes as an example) after the execution of
inline asm?

I'm thinking of ways around the issue, but the basic setup is as follows:

pushfl
somefunctioncall(a, b, c)
popfl

pushfl modifies the stack so some stack operations hardcoded by GCC are causing
problems.  If somefunctioncall is inlined, that helps a lot.

I was thinking of doing something like this (rough syntax).  
***************************
int a;
pushfl
popl a

somefunctioncall(a, b, c)

pushl a
popfl
***************************

The only issue with that is that this type of coding (pushfl, popfl) are
assembler defines used all over the place.  Sometimes in a hierachy of such
calls.  These cases will have to be done on a 1 to 1 basis.

Yamin

----------------------------------------
This mail sent through www.mywaterloo.ca


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]