help?

Questions or HOWTOs about the above? Post 'em here...
Post Reply
elmer fudd
Private First Class
Private First Class
Posts: 109
Joined: Fri May 07, 2004 11:17 pm
Contact:

help?

Post by elmer fudd » Thu Jun 03, 2004 11:27 am

compiling in cvs, with OS X 10.3

i get this error:

Code: Select all

/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h: In function `void 
   parse(int, char**, CmdLineOptions&, bool)':
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload
/usr/include/gcc/darwin/3.3/c++/ppc-darwin/bits/atomicity.h:65: error: `asm' 
   operand requires impossible reload

rob1n
Private First Class
Private First Class
Posts: 122
Joined: Wed Apr 21, 2004 10:53 pm

Post by rob1n » Fri Jun 04, 2004 4:18 am

you might try reinstalling gcc...

i have 10.2 and it compiles fine...learner?

elmer fudd
Private First Class
Private First Class
Posts: 109
Joined: Fri May 07, 2004 11:17 pm
Contact:

Post by elmer fudd » Fri Jun 04, 2004 10:24 am

Code: Select all

#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H       1

#ifdef __PPC405__
#define _STWCX "sync \n\tstwcx. "
#else
#define _STWCX "stwcx. "
#endif

typedef int _Atomic_word;

static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
  _Atomic_word __tmp, __res;
  __asm__ __volatile__ (
        "/* Inline exchange & add */\n"
        "0:\t"
        "lwarx    %0,0,%2 \n\t"
        "add%I3   %1,%0,%3 \n\t"
        _STWCX "  %1,0,%2 \n\t"
        "bne-     0b \n\t"
        "/* End exchange & add */"
        : "=&b"(__res), "=&r"(__tmp)
        : "r" (__mem), "Ir"(__val)
        : "cr0", "memory");
  return __res;
}

static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word *__mem, int __val)
{
  _Atomic_word __tmp;
  __asm__ __volatile__ (
        "/* Inline atomic add */\n"
        "0:\t"
        "lwarx    %0,0,%1 \n\t"
        "add%I2   %0,%0,%2 \n\t"
        _STWCX "  %0,0,%1 \n\t"
        "bne-     0b \n\t"
        "/* End atomic add */"
        : "=&b"(__tmp)
        : "r" (__mem), "Ir"(__val)
        : "cr0", "memory");
}

#endif /* atomicity.h */
thats mine... whats yours?

User avatar
learner
General
General
Posts: 270
Joined: Sun May 11, 2003 2:06 am
Location: Maryland
Contact:

gcc bug

Post by learner » Fri Jun 04, 2004 1:21 pm

This is a really deep g++ stl bug that usually pokes it's head up every now and then. There are a variety of ways to get around the problem. Usually the proper fix involves editing the source code to be unambigous about the particular section that causes the problem. The problematic code usually has to deal with copying, clobber, or modifying std::string references.

For the non-coder, I'd recommend just trying to type "make" again. You might just get lucky. ;) Assuming that fails, you can retry the build with a different optimization level. This needs to be done from the configure step, e.g. "./configure CXXFLAGS=-O2". Then run "make" again, it shouldn't matter whether you make clean first.

Otherwise, you'll have to wait till I rebuild, get sufficiently annoyed by the error, and fix whatever code is causing the problem (usually a day or two).

Cheers!

elmer fudd
Private First Class
Private First Class
Posts: 109
Joined: Fri May 07, 2004 11:17 pm
Contact:

Post by elmer fudd » Sat Jun 05, 2004 5:16 pm

works now thx learner
EDIT::: nope still fails

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests