Assert problem with QT4.3 on powerpc.

Simon Hausmann hausmann at kde.org
Mon Apr 2 14:42:57 BST 2007


On Monday 02 April 2007 15:34:25 Tom Albers wrote:
> At Monday 02 April 2007 15:13, you wrote:
> > Jon had the same problem at #kde-devel-es. I'm pretty sure he did a diff
> > of QtCore/qatomic_powerpc.h from 4.2, saw the changes, probably copied it
> > over the 4.3 version and recompiled everything. That fixed his problems
> > at PPC.
> >
> > Well, was a desperate solution till Trolltech fixes it :)
>
> Do you think you can get your hands on that patch and post it here for
> review?

This is the patch I posted to the qt4-preview-feedback list this morning. Can 
you give it a try?


Thanks,
Simon
-------------- next part --------------
==== //depot/qt/4.3/src/corelib/arch/qatomic_powerpc.h#2 - /home/shausman/dev/qt-4.3/src/corelib/arch/qatomic_powerpc.h ====
--- /tmp/tmp.653.23	2007-04-02 11:54:15.000000000 +0200
+++ /home/shausman/dev/qt-4.3/src/corelib/arch/qatomic_powerpc.h	2007-04-02 11:54:01.000000000 +0200
@@ -51,16 +51,16 @@ inline int q_atomic_test_and_set_acquire
 {
     register int tmp;
     register int ret;
-    asm volatile("lwarx  %0,0,%3\n"
-                 "cmpw   %0,%4\n"
+    asm volatile("lwarx  %0,0,%2\n"
+                 "cmpw   %0,%3\n"
                  "bne-   $+20\n"
-                 "stwcx. %5,0,%3\n"
+                 "stwcx. %4,0,%2\n"
                  "bne-   $-16\n"
                  "li     %1,1\n"
                  "b      $+8\n"
                  "li     %1,0\n"
                  "eieio\n"
-                 : "=&r" (tmp), "=&r" (ret), "=m" (*ptr)
+                 : "=&r" (tmp), "=&r" (ret)
                  : "r" (ptr), "r" (expected), "r" (newval)
                  : "cc", "memory");
     return ret;
@@ -71,15 +71,15 @@ inline int q_atomic_test_and_set_release
     register int tmp;
     register int ret;
     asm volatile("eieio\n"
-                 "lwarx  %0,0,%3\n"
-                 "cmpw   %0,%4\n"
+                 "lwarx  %0,0,%2\n"
+                 "cmpw   %0,%3\n"
                  "bne-   $+20\n"
-                 "stwcx. %5,0,%3\n"
+                 "stwcx. %4,0,%2\n"
                  "bne-   $-16\n"
                  "li     %1,1\n"
                  "b      $+8\n"
                  "li     %1,0\n"
-                 : "=&r" (tmp), "=&r" (ret), "=m" (*ptr)
+                 : "=&r" (tmp), "=&r" (ret)
                  : "r" (ptr), "r" (expected), "r" (newval)
                  : "cc", "memory");
     return ret;
@@ -89,15 +89,15 @@ inline int q_atomic_test_and_set_ptr(vol
 {
     register void *tmp;
     register int ret;
-    asm volatile(LPARX"  %0,0,%3\n"
-                 CMPP"   %0,%4\n"
+    asm volatile(LPARX"  %0,0,%2\n"
+                 CMPP"   %0,%3\n"
                  "bne-   $+20\n"
-                 STPCX"  %5,0,%3\n"
+                 STPCX"  %4,0,%2\n"
                  "bne-   $-16\n"
                  "li     %1,1\n"
                  "b      $+8\n"
                  "li     %1,0\n"
-                 : "=&r" (tmp), "=&r" (ret), "=m" (*reinterpret_cast<volatile long *>(ptr))
+                 : "=&r" (tmp), "=&r" (ret)
                  : "r" (ptr), "r" (expected), "r" (newval)
                  : "cc", "memory");
     return ret;
@@ -107,11 +107,11 @@ inline int q_atomic_increment(volatile i
 {
     register int ret;
     register int one = 1;
-    asm volatile("lwarx  %0, 0, %2\n"
-                 "add    %0, %3, %0\n"
-                 "stwcx. %0, 0, %2\n"
+    asm volatile("lwarx  %0, 0, %1\n"
+                 "add    %0, %2, %0\n"
+                 "stwcx. %0, 0, %1\n"
                  "bne-   $-12\n"
-                 : "=&r" (ret), "=m" (*ptr)
+                 : "=&r" (ret)
                  : "r" (ptr), "r" (one)
                  : "cc", "memory");
     return ret;
@@ -121,11 +121,11 @@ inline int q_atomic_decrement(volatile i
 {
     register int ret;
     register int one = -1;
-    asm volatile("lwarx  %0, 0, %2\n"
-                 "add    %0, %3, %0\n"
-                 "stwcx. %0, 0, %2\n"
+    asm volatile("lwarx  %0, 0, %1\n"
+                 "add    %0, %2, %0\n"
+                 "stwcx. %0, 0, %1\n"
                  "bne-   $-12\n"
-                 : "=&r" (ret), "=m" (*ptr)
+                 : "=&r" (ret)
                  : "r" (ptr), "r" (one)
                  : "cc", "memory");
     return ret;
@@ -134,10 +134,10 @@ inline int q_atomic_decrement(volatile i
 inline int q_atomic_set_int(volatile int *ptr, int newval)
 {
     register int ret;
-    asm volatile("lwarx  %0, 0, %2\n"
-                 "stwcx. %2, 0, %2\n"
+    asm volatile("lwarx  %0, 0, %1\n"
+                 "stwcx. %2, 0, %1\n"
                  "bne-   $-8\n"
-                 : "=&r" (ret), "=m" (*ptr)
+                 : "=&r" (ret)
                  : "r" (ptr), "r" (newval)
                  : "cc", "memory");
     return ret;
@@ -146,10 +146,10 @@ inline int q_atomic_set_int(volatile int
 inline void *q_atomic_set_ptr(volatile void *ptr, void *newval)
 {
     register void *ret;
-    asm volatile(LPARX"  %0, 0, %2\n"
-                 STPCX"  %2, 0, %2\n"
+    asm volatile(LPARX"  %0, 0, %1\n"
+                 STPCX"  %2, 0, %1\n"
                  "bne-   $-8\n"
-                 : "=&r" (ret), "=m" (*reinterpret_cast<volatile long *>(ptr))
+                 : "=&r" (ret)
                  : "r" (ptr), "r" (newval)
                  : "cc", "memory");
     return ret;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070402/eeed6443/attachment.sig>


More information about the kde-core-devel mailing list