[Bug inline-asm/20718] "+r" constraint with uninitialized value

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Apr 1 19:19:00 GMT 2005


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-01 19:19 -------
This is not a regression and here is an example (compile on 3.2.3 with -O2 -
fomit-frame-pointer on i686-pc-linux-gnu and you get the same behavior as 
pointed out here):
unsigned long foo (unsigned long *a, unsigned long *b,
                   unsigned long *c, int d)
{
  unsigned long e, f,g,h;
 // e = 0;f = 0;


  if (d <= 0) return 0;
  asm ("# registers %0 %1 %2 %3 %4 %5 %6 %7"
       : "+a" (e),"+c" (d), "+r" (f), "+r"(g)
       : "r" (a), "r" (b), "r" (c), "r"(h));
  return e;
}


------ asm ----
#APP
        # registers %eax %ecx %edx %ebp %edi %esi %ebx %edx
#NO_APP

Notice how edx are used for both input and output registers.

-- 


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



More information about the Gcc-bugs mailing list