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/39620] New: wrong assumption of clobbered registers of inline assembly


I have the following code:

static inline void zeromem4b(uint32t *dst, uint32t count) {
        asm volatile("xor %%eax,%%eax\n\trep stosl"
                :
                :"c"(count),"D"(dst)
                :"%eax", "cc", "memory");
}

If I call it and after it want to, e.g. print out the value of *dst it gives me
the value which it has after running the function. That means that gcc thinks
that "%edi" hasn´t changed, but it did and I can not put it into the clobbered
list, because this gives me an error.

I compile with "-O2 -Wall -fno-builtin -march=i586".


-- 
           Summary: wrong assumption of clobbered registers of inline
                    assembly
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: codemasterhs at yahoo dot de
  GCC host triplet: cygwin
GCC target triplet: i586 elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39620


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