Clobbered registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I wrote a function which modifies esp register through some asm
instructions (it pushes things to the stack). Everything works perfect
for now because the function takes care of restauring the content of
esp issuing an add instruction too so that it can return allright. But
reading GCC docs I found this:

"If you refer to a particular hardware register from the assembler
code, you will probably have to list the register after the third
colon to tell the compiler the register's value is modified."

Ok, so I do that. But looking at the assembler code generated by the
compiler I notice that it is exactly the same than before I did what
the docs say. So I wonder, why does the compiler needs to know if I
execute an instruction that modifies some register? And also (maybe
the answer to the former would respond this) why does the code doesn't
change?

Thanks a lot,
FaQ

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux