NOTE: Defaulting component because reported component no longer exists
When compile with gcc-3.4 -O1 -fgcse -c -o qemu-bug.o qemu-bug.c,
there will be the error:

[EMAIL PROTECTED]:~/src/qemu-bug$ gcc-3.4 -O1 -fgcse -c -o qemu-bug.o qemu-bug.c
qemu-bug.c: In function `main':
qemu-bug.c:2: error: inconsistent operand constraints in an `asm'
qemu-bug.c:2: error: inconsistent operand constraints in an `asm'

Without -fgcse, there will no error, -O2 -fno-gcse does work as well.

Environment:
System: Linux Pegasos 2.6.16 #3 PREEMPT Sat Apr 8 18:28:12 CEST 2006 ppc
GNU/Linux
Architecture: ppc


host: powerpc-unknown-linux-gnu
build: powerpc-unknown-linux-gnu
target: powerpc-unknown-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,f77,pascal
--prefix=/usr --libexecdir=/usr/lib --with-gxx-include-dir=/usr/include/c++/3.4
--enable-shared --with-system-zlib --enable-nls --without-included-gettext
--program-suffix=-3.4 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --disable-softfloat
--enable-targets=powerpc-linux,powerpc64-linux --with-cpu=default32
--disable-softfloat powerpc-linux-gnu

How-To-Repeat:
# 1 "qemu-bug.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "qemu-bug.c"
inline void stl(void *ptr, int v) {
    __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*(unsigned long *)ptr) : "r"
(v), "r" (ptr));
}

int main () {
  unsigned long *sp, *u_platform;
  char *k_platform;



  stl(sp, (unsigned long)(0)); stl(sp+1, (unsigned long)(0));;

  if (k_platform)
    stl(sp, (unsigned long)(15)); stl(sp+1, (unsigned long)((unsigned long)
u_platform));;
  return 0;
}


-- 
           Summary: Compiling a special asm-statment will fail if -O1 -fgcse
                    is set.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: pending
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: didischuster at arcor dot de
 GCC build triplet: powerpc-unknown-linux-gnu
  GCC host triplet: powerpc-unknown-linux-gnu
GCC target triplet: powerpc-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27092

Reply via email to