Bug 7383 - atomic operations not atomic on ppc405
Summary: atomic operations not atomic on ppc405
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.1
: P3 normal
Target Milestone: ---
Assignee: David Edelsohn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-22 21:16 UTC by dank
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dank 2002-07-22 21:16:01 UTC
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.
Comment 1 dank 2002-07-22 21:16:01 UTC
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.
Comment 2 Benjamin Kosnik 2002-07-24 12:42:54 UTC
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
Comment 3 dank 2002-07-25 12:02:18 UTC
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
Comment 4 David Edelsohn 2002-09-20 14:30:05 UTC
Responsible-Changed-From-To: unassigned->dje
Responsible-Changed-Why: PowerPC
Comment 5 David Edelsohn 2002-09-20 14:30:05 UTC
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.