We were changing the edi register, but not informing the compiler about this.
For certain optimization combinations, the compiler would assume edi was
unchanged. Fixed by adding %edi to the clobber list.
Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c
Modified: trunk/reactos/subsys/win32k/dib/dib32bpp.c

Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c
--- trunk/reactos/subsys/win32k/dib/dib16bpp.c	2005-06-13 21:51:42 UTC (rev 15900)
+++ trunk/reactos/subsys/win32k/dib/dib16bpp.c	2005-06-13 22:24:28 UTC (rev 15901)
@@ -17,6 +17,7 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 /* $Id$ */
+
 #include <w32k.h>
 
 VOID
@@ -53,6 +54,7 @@
 "  shl  $16, %%eax\n"
 "  andl $0xffff, %0\n"  /* If the pixel value is "abcd", put "abcdabcd" in %eax */
 "  or   %0, %%eax\n"
+"  mov  %2, %%edi\n"
 "  test $0x03, %%edi\n" /* Align to fullword boundary */
 "  jz   .L1\n"
 "  stosw\n"
@@ -67,8 +69,8 @@
 "  stosw\n"
 ".L2:\n"
   : /* no output */
-  : "r"(c), "r"(Count), "D"(addr)
-  : "%eax", "%ecx");
+  : "r"(c), "r"(Count), "m"(addr)
+  : "%eax", "%ecx", "%edi");
 #else /* _M_IX86 */
   LONG cx = x1;
   DWORD cc;
@@ -443,8 +445,8 @@
   {   
   __asm__ __volatile__ (
     "  cld\n"
-    "  mov  %0,%%eax\n"
     "  mov  %1,%%ebx\n" 
+    "  mov  %2,%%edi\n" 
     "  test $0x03, %%edi\n" /* Align to fullword boundary */
     "  jz   .FL1\n"
     "  stosw\n"
@@ -458,9 +460,9 @@
     "  jz   .FL2\n"
     "  stosw\n"
     ".FL2:\n"
-    : 
-    : "r" (color), "r" (width), "D" (pos)
-    : "%eax", "%ecx","%ebx");
+    :
+    : "a" (color), "r" (width), "m" (pos)
+    : "%ecx", "%ebx", "%edi");
      pos =(PULONG)((ULONG_PTR)pos + delta);	 
   }
 

Modified: trunk/reactos/subsys/win32k/dib/dib32bpp.c
--- trunk/reactos/subsys/win32k/dib/dib32bpp.c	2005-06-13 21:51:42 UTC (rev 15900)
+++ trunk/reactos/subsys/win32k/dib/dib32bpp.c	2005-06-13 22:24:28 UTC (rev 15901)
@@ -52,6 +52,7 @@
     __asm__ __volatile__ (
 "  cld\n"
 "  mov  %0, %%eax\n"
+"  mov  %2, %%edi\n"
 "  test $0x03, %%edi\n" /* Align to fullword boundary */
 "  jnz   .L1\n"
 "  mov  %1,%%ecx\n"     /* Setup count of fullwords to fill */
@@ -67,8 +68,8 @@
 "  stosw\n"
 ".L2:\n"
   : /* no output */
-  : "r"(c), "r"(cx), "D"(addr)
-  : "%eax", "%ecx");
+  : "m"(c), "r"(cx), "m"(addr)
+  : "%eax", "%ecx", "%edi");
 
   
 }