This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: FW: Inline assembly, clobber registers, ask for help
- From: Tamas Nagy <nagytam at web dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 21 Jan 2003 10:19:01 +0100
- Subject: Re: FW: Inline assembly, clobber registers, ask for help
- Organization: http://freemail.web.de/
Thanks for your comments.
I converted the code not to use predefined general registers, and it seems it is working now, even with optimizations. Apart from this, I would like to learn more about this topic.
You mentioned that gcc needs 1 or two registers for saving/restoring clobbered registers.
Why gcc tries to do this in every case? I could imagine a lot of code, where an inline assembly routine could use registers and after it it has not to be restored. E.g. later initialized with a contant...
Another solution would be to use POPA/PUSHA if there are no general registers available. Currently gcc miscompiles the code in case of optimizations, if I understood/experience right.
In general, what kind of tasks are gcc doing prior/middle/after to an inline assembly code, when optimizations are enabled? (Is there any documentation to read more about this? Thanks for pointing out in a private mail the gcc manual 'Extensions to the C language' chapter.)
I use gcc version 3.2.2 20030109. I assume ECX as a member of general register class, but gcc provides the following error message:
"can't find a register in 'GENERAL_REGS while reloading asm".
EAX, EBX are fine ECX not.
I really appreciate your help,
Tamas
______________________________________________________________________________
Wieviele E-Mail-Adressen haben Sie? Eine, funf oder gar zehn? Verwalten
Sie doch einfach alle unter: http://freemail.web.de/features/?mc=021120