Page 1 of 1

help?

Posted: Thu Jun 03, 2004 11:27 am
by elmer fudd
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

Posted: Fri Jun 04, 2004 4:18 am
by rob1n
you might try reinstalling gcc...

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

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

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?

gcc bug

Posted: Fri Jun 04, 2004 1:21 pm
by learner
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!

Posted: Sat Jun 05, 2004 5:16 pm
by elmer fudd
works now thx learner
EDIT::: nope still fails