This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33527] GCC doesn't protect %edi when using inline assembly
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Sep 2007 07:27:41 -0000
- Subject: [Bug c/33527] GCC doesn't protect %edi when using inline assembly
- References: <bug-33527-15137@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from ebotcazou at gcc dot gnu dot org 2007-09-22 07:27 -------
> The problem is, movsb changes the value of %esi and %edi, and I told the
> compiler about this in the "input" section in the asm directive.
No, you didn't, you only told that %esi and %edi should be loaded on entry.
See section 5.35 of the manual, especially the paragraph starting with "Some
instructions clobber specific hard registers". Note that the provision "You
may not write a clobber description in a way that overlaps with an input or
output operand" will apply in this case, so 'volatile' will be required.
--
ebotcazou at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot gnu dot
| |org
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33527