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 libertysurf dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Sep 2007 10:22:33 -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 #2 from ebotcazou at libertysurf dot fr 2007-09-22 10:22 -------
Subject: Re: GCC doesn't protect %edi when using inline assembly
> I've tried 'volatile', but it doesn't work.
#include <stdio.h>
int main(void)
{
char input[] = {"GCC Version Number"};
char output[30],*dummy;
int length = 28;
asm volatile (
"cld\n\t"
"rep movsb"
: "=S"(dummy),"=D"(dummy)
: "c"(length), "0"(input), "1"(output));
printf("%s\n", output);
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33527