From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9102 invoked by alias); 4 Jan 2002 23:36:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 9088 invoked by uid 71); 4 Jan 2002 23:36:00 -0000 Date: Fri, 04 Jan 2002 15:36:00 -0000 Message-ID: <20020104233600.9087.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Aaron J. Grier" Subject: Re: libstdc++/5198: 3.0.3 linux x m68k build fail: invalid opcodes in c++locale.cc Reply-To: "Aaron J. Grier" X-SW-Source: 2002-01/txt/msg00178.txt.bz2 List-Id: The following reply was made to PR libstdc++/5198; it has been noted by GNATS. From: "Aaron J. Grier" To: Craig Rodrigues Cc: Don Lindsay , rodrigc@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: libstdc++/5198: 3.0.3 linux x m68k build fail: invalid opcodes in c++locale.cc Date: Fri, 4 Jan 2002 15:25:14 -0800 On Fri, Jan 04, 2002 at 05:43:39PM -0500, Craig Rodrigues wrote: > On Fri, Jan 04, 2002 at 02:34:11PM -0800, Aaron J. Grier wrote: > > the fault is with libstdc++-v3, specifically > > > > libstdc++-v3/config/cpu/m68k/bits/atomicity.h > > > > which includes "cas" as an inlined assembly instruction in a supposedly > > generic m68k include file. > > > > I've been able to identify at least three cases that need to be covered > > in atomicity.h: > > > > 68020/30/40: use current "cas" > > mcpu32 and v4 coldfire: "tas" on a static local variable > > 68000/010, v2/3 coldfire: disable interrupts > > > > I'm preparing a quick-and-dirty patch for people to go over, but if > > someone beats me to it, more power to them. :) > > If you can submit a good patch for atomicity.h, please do. > You can look at the proposed patch from Peter Barada here: > http://gcc.gnu.org/ml/gcc/2002-01/msg00328.html > > That might give you an idea of what macros to use. except as Nathan Myers pointed out in a followup (which apparently hasn't made it to the web archive yet), Peter's solution won't work since you could be interrupted by another thread between the add and cmp instructions. -- Aaron J. Grier | Frye Electronics, Tigard, OR | aaron@frye.com "In a few thousand years people will be scratching their heads wondering how on earth the first computer was invented and bootstrapped without a prior computer to do it with." -- Chris Malcolm, on comp.arch