Modified task #874 in gcc: ICE: in emit_move_insn, at expr.c:3165 (inline assembly?)

Flyspray - The bug killer! btsadmin at pld-linux.org
Mon Aug 15 15:49:39 CEST 2005


Project: PLD 2.x (Ac)
  
  Package: gcc
  Summary: ICE: in emit_move_insn, at expr.c:3165 (inline assembly?)
  Changed by: Pawel Sikora (pluto)

Changes:
-----
Project: PLD 2.x (Ac)
Summary: ICE: in emit_move_insn, at expr.c:3165 (inline assembly?)
Task Type: Bug Report
Category: gcc
** Status: Assigned
Architecture: All
** Severity: Medium
** Priority Normal
Reported Version: 5:3.3.3-2
Due in Version: 
Percent Complete: 0
Details: *************************************
gcc -Wall -v --save-temps -c main.cc:
*************************************

Reading specs from /usr/lib/gcc-lib/i386-pld-linux/3.3.3/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-languages=c,c++,f77,objc,ada,java,ksi --enable-c99
--enable-long-long --enable-multilib --enable-nls --with-gnu-as
--with-gnu-ld --with-system-zlib --with-slibdir=/lib --without-x
i386-pld-linux
Thread model: posix
gcc version 3.3.3 (PLD Linux)
 /usr/lib/gcc-lib/i386-pld-linux/3.3.3/cc1plus -E -D__GNUG__=3 -quiet
-v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3
-D_GNU_SOURCE main.cpp main.ii
ignoring nonexistent directory "/usr/include/c++/3.3.3"
ignoring nonexistent directory "/usr/include/c++/3.3.3/i386-pld-linux"
ignoring nonexistent directory "/usr/include/c++/3.3.3/backward"
ignoring nonexistent directory "/usr/i386-pld-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i386-pld-linux/3.3.3/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-pld-linux/3.3.3/cc1plus -fpreprocessed main.ii
-quiet -dumpbase main.cpp -auxbase main -version -o main.s
GNU C++ version 3.3.3 (PLD Linux) (i386-pld-linux)
	compiled by GNU C version 3.3.3 (PLD Linux).
GGC heuristics: --param ggc-min-expand=64 --param
ggc-min-heapsize=64225
main.cpp: In function `bool cas(volatile T&, const T&, const T&) [with
T = 
   lockfree::queue<packet::buffer_base>::atomic_ptr]':
main.cpp:13: internal compiler error: in emit_move_insn, at
expr.c:3165
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.pld-linux.org/> for instructions.

*************************************
main.ii: Code that triggers ICE (reduced)
*************************************

# 1 "main.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "main.cpp"




template<typename T> bool cas(volatile T& what, const T& test_val,
const T& new_val) __attribute__((always_inline));
template<typename T> bool cas(volatile T& what, const T& test_val,
const T& new_val)
{
        bool ret;
        switch (sizeof(T))
        {
                case 4:
                {
                        __asm__ __volatile__
                        (
                                "cmpxchgl %1,%2;nt"
                                "sete %0;nt"
                                :
                                "=q"(ret)
                                :
                                "q"(new_val),
                                "m"(what),
                                "a"(test_val)
                                :
                                "memory", "cc"
                        );
                        return ret;
                }
                case 8:
                {
                        bool ret;
                        __asm__ __volatile__
                        (
                                "cmpxchg8b %5;nt"
                                "sete %0;nt"
                                :
                                "=q" (ret)
                                :
                                "a" (((unsigned long*)&test_val)[0]),
                                "d" (((unsigned long*)&test_val)[1]),
                                "b" (((unsigned long*)&new_val )[0]),
                                "c" (((unsigned long*)&new_val )[1]),
                                "m" (what)
                                :
                                "memory", "cc"
                        );
                        return ret;
                }
                default:
                {

                        return false;
                }
        }
}

namespace lockfree
{
        template<class T> class queue
        {
        public:
                class lifo_fifo_base {};
                class node;

        protected:
                class node_base
                {
                public:
                        node* next;
                        node_base(): next(0) {}
                };

        public:
                class node: public node_base, public T
                {
                public:
                        lifo_fifo_base* container;

                        node(): node_base(), T(), container(0) {}
                };

        protected:
                class atomic_ptr
                {
                public:
                        node_base nod;
                        unsigned long ver;

                        atomic_ptr(): ver(0) {}
                        atomic_ptr(const volatile atomic_ptr& a) {ver =
a.ver;nod.next = a.nod.next;}
                        atomic_ptr& operator = (const volatile
atomic_ptr& a) {ver = a.ver; nod.next = a.nod.next; return *this;}
                };

        public:
                class lifo: public lifo_fifo_base
                {
                private:
                        volatile atomic_ptr head;

                public:
                        lifo() {}

                        node* pop(void)
                        {
                                atomic_ptr ol;
                                atomic_ptr ne;

                                do
                                {
                                        ol = head;
                                        ne.nod.next =
ol.nod.next->next;
                                        ne.ver = ol.ver + 1;
                                }
                                while(!cas(head, ol, ne));

                                bool rc =
cas<lifo_fifo_base*>(ol.nod.next->container, this, 0);


                                return ol.nod.next;
                        }
                };
        };
};

namespace packet
{
        class buffer_base
        {
        public:
                buffer_base() {};
                void* data;
        };

        typedef lockfree::queue<buffer_base> queue;

        typedef queue::node buffer;
        typedef queue::lifo lifo;

        extern lifo free;

        buffer* new_buffer(void)
        {
                buffer* ret = free.pop();
                return ret;
        }
};

int main(int argc, char *argv[])
{
        return 0;
}


-----

For more further see:
http://bugs.pld-linux.org/index.php?do=details&id=874}

------------------------------------------------------------------------
THIS IS AN AUTOMATICALLY GENERATED MESSAGE, DO NOT REPLY




More information about the pld-bugs mailing list