Routines such as atomic_add() that use the stwcx instruction fail occasionally, as the ppc405cr occasionally misbehaves if the stwcx instruction interrupted. See erratum 77 in http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf See also http://www.kegel.com/xgcc3/ppc405erratum77.html Release: gcc-3.1 Environment: IBM PPC405 embedded processor How-To-Repeat: Difficult. We have reproduced it by running a large C++ program under network load on a 128-computer farm of uniprocessor machines; failure usually happens within 1000 to 2000 cpu-minutes. We have not yet found a small testcase; we're still trying.
Fix: Apply workaround 4 from IBM's erratum sheet. Patch available at http://www.kegel.com/xgcc3/gcc-20020715-ppc405erratum77.patch Patch does seem to fix the libstdc++ problem, and should be suitable for mainline use. Note: patch does not fix libgcj or boehm-gc, which are also affected by this problem. They will need a similar patch.
State-Changed-From-To: open->analyzed State-Changed-Why: It looks like this has been resolved, this patch just needs to be applied. Can somebody take care of this? (I nominate the powerpc port maintainers.) -benjamin
From: dank@kegel.com To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, dank@kegel.com, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: libstdc++/7383: atomic operations not atomic on ppc405 Date: Thu, 25 Jul 2002 12:02:18 -0700 I have updated my patch to also fix the stwcx in boehm-gc used by gcj; see http://www.kegel.com/xgcc3/gcc-20020722-ppc405erratum77.patch This new patch is untested, but extremely similar to the earlier patch which did seem to fix the libstdc++ problem, and simple enough that one might be able to trust it by inspection. Note that libc/4155 is related; you have to fix both. http://bugs.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4155 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7383
Responsible-Changed-From-To: unassigned->dje Responsible-Changed-Why: PowerPC
State-Changed-From-To: analyzed->closed State-Changed-Why: GCC 3.3 includes the fix when GCC is configured for PPC405. A PPC405 multilib will not be created.