This is the mail archive of the gcc-bugs@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]

[Bug c/33527] GCC doesn't protect %edi when using inline assembly



------- 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


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