public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* Compiler Error
@ 1999-05-31 21:06 linneman
  1999-05-23  1:03 ` Martin v. Loewis
  0 siblings, 1 reply; 24+ messages in thread
From: linneman @ 1999-05-31 21:06 UTC (permalink / raw)
  To: egcs-bugs

Dear Sirs,

I use the C++ Compiler egcs-2.91.66 and got the following error-message:

...
bsp_vector.cpp:43:   instantiated from here
/usr/local/include/g++/fmol/vector.h:612: Internal compiler error.
/usr/local/include/g++/fmol/vector.h:612: Please submit a full bug report to
`egcs-bugs@egcs.cygnus.com'.
/usr/local/include/g++/fmol/vector.h:612: See
<URL: http://egcs.cygnus.com/faq.html#bugreport > for details.


when compiling the source "bsp_vector.cpp". Because attaching the source-code
is not accepted by your mailserver (filesize larger than 10k), I put a link ("
EGCS-Compilererror) to it on my home page: 

http://rcswww.urz.tu-dresden.de/~linneman/

(Please use the right mouse-button to get the file dialog in order to download
the tar.gz file")

Please put the directory "fmol" in your c++ standard include directory before
compiling.

The sources belong to a project that is realized on the Dresden University of
Technology originally written with Microsoft Visual C++ 5.0. I would like to
port the code to GNU/egcs development enviroment.

Hoping to get some help,

Yours sincerely,

Otto Linnemann


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Compiler error
@ 2001-04-11 17:51 M.Wilkens
  2001-04-11 18:56 ` Alexandre Oliva
  0 siblings, 1 reply; 24+ messages in thread
From: M.Wilkens @ 2001-04-11 17:51 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]

Hello,

here the following information from my system and the compiler error:

Version: gcc version 2.95.3 19991030 (prerelease)
----------------------------------------------------------
System Type: /usr/lib/gcc-lib/i586-mandrake-linux/2.95.3/specs
----------------------------------------------------------
Compiler Output:
 /home/manatwork/linux/include/linux/fs.h:1354: cannot convert to a pointer 
type
In file included from /home/manatwork/linux/include/linux/sched.h:26,
                 from console.c:75:
/home/manatwork/linux/include/linux/signal.h: In function `siginitsetinv':
/home/manatwork/linux/include/linux/signal.h:205: Internal compiler error in 
`do
_abort', at toplev.c:2289
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
cpp: output pipe has been closed
make[3]: *** [console.o] Fehler 1
make[3]: Verlassen des Verzeichnisses Verzeichnis 
»/home/manatwork/linux/drivers
/char«
make[2]: *** [first_rule] Fehler 2
make[2]: Verlassen des Verzeichnisses Verzeichnis 
»/home/manatwork/linux/drivers
/char«
make[1]: *** [_subdir_char] Fehler 2
make[1]: Verlassen des Verzeichnisses Verzeichnis 
»/home/manatwork/linux/drivers
«
make: *** [_dir_drivers] Fehler 2     
-----------------------------------------------------------
the Option: make bzImage 
-----------------------------------------------------------


regards
M.Wilkens      


^ permalink raw reply	[flat|nested] 24+ messages in thread
[parent not found: <00033016040105.02815@kanga.pjprimer.com>]
[parent not found: <388C2FFC.50C337EE@mp-sun1.informatik.uni-mannheim.de>]
* Compiler error
@ 1999-11-12 22:39 Jake Kreutzer
  1999-11-15 16:21 ` Alexandre Oliva
  0 siblings, 1 reply; 24+ messages in thread
From: Jake Kreutzer @ 1999-11-12 22:39 UTC (permalink / raw)
  To: egcs-bugs

	Hi, I was trying to compile libstdc++2.90.6 from ftp.gnu.org, and
I got the following error.  Do you think you could help me out?  Let me
know if you need more information.

Here is the error:
c++ -DHAVE_CONFIG_H -I. -I. -I.. -nostdinc++ -I.. -I../stl -I../libio -g
-D_GNU_SOURCE -fno-implicit-templates -fimplicit-templates -c  -fPIC -DPIC
misc-inst.cc -o .libs/misc-inst.lo
../bits/std_ostream.h: In function `class
basic_ostream<char,char_traits<char> > & operator
<<<char_traits<char>>(class basic_ostream<char,char_traits<char> > &,
const char *)':
misc-inst.cc:102:   instantiated from here
../bits/std_ostream.h:465: Internal compiler error.
../bits/std_ostream.h:465: Please submit a full bug report to
`egcs-bugs@cygnus.com'.
../bits/std_ostream.h:465: See
<URL: http://egcs.cygnus.com/faq.html#bugreport > for details.
make[2]: *** [misc-inst.lo] Error 1
make[2]: Leaving directory `/home/jakek/libstdc++-2.90.6/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jakek/libstdc++-2.90.6'
make: *** [all-recursive-am] Error 2
S8-41-4:~/libstdc++-2.90.6$ 

Thanks,

Jake
"Bother," said Pooh, "Eeyore, ready two photon torpedoes and lock phasers
on the Heffalump, Piglet, meet me in transporter room three."



^ permalink raw reply	[flat|nested] 24+ messages in thread
* compiler error
@ 1999-11-03  0:41 Trevor Spiteri
  1999-11-30 23:39 ` Nathan Sidwell
  0 siblings, 1 reply; 24+ messages in thread
From: Trevor Spiteri @ 1999-11-03  0:41 UTC (permalink / raw)
  To: egcs-bugs

The source file err.cc follows:

template <class T>
class c {
public:
   int p;
   void f()
   {
      c<int> r;
      r.p = (typeof(r.p))3;
   }
};

When I try to compile err.cc with the command
egcs -v err.cc
I get the following:

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ err.cc /tmp/cc9Je7C0.ii
GNU CPP version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++-2
 /usr/i386-redhat-linux/include
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cc1plus /tmp/cc9Je7C0.ii -quiet -dumpbase err.cc -version -o /tmp/cc4B32NQ.s
GNU C++ version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386-redhat-linux) compiled by GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
err.cc: In method `void c<T>::f()':
err.cc:8: Internal compiler error.
err.cc:8: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
err.cc:8: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for details.


^ permalink raw reply	[flat|nested] 24+ messages in thread
* compiler error
@ 1999-07-31 23:33 Jens Krüger
  1999-07-16  0:26 ` Martin v. Loewis
  0 siblings, 1 reply; 24+ messages in thread
From: Jens Krüger @ 1999-07-31 23:33 UTC (permalink / raw)
  To: egcs-bugs

[-- Attachment #1: Type: text/plain, Size: 2716 bytes --]

Operating System :  
kernel Linux 2.2.9  i586 unknown
SuSE 6.0
Version of egcs:         
egcs-2.91.60

Error message:
c++ -DHAVE_CONFIG_H -I. -I. -I.. -nostdinc++ -I.. -I../stl -I../libio -g -D_GNU_SOURCE -fno-implicit-templates -fimplicit-templates -c  -fPIC -DPIC misc-inst.cc -o .libs/misc-inst.lo
../bits/std_ostream.h: In function `class basic_ostream<char,char_traits<char> > & operator <<<char_traits<char>>(class basic_ostream<char,char_traits<char> > &, const char *)':
misc-inst.cc:100:    instantiated from here
../bits/std_ostream.h:425: Internal compiler error.
../bits/std_ostream.h:425: Please submit a full bug report to `egcs-bugs@cygnus.com'.
../bits/std_ostream.h:425: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for details.

I tried to compile the libstdc++-2.90.5
output from c++ -v --save-temps  ....
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/specs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
 /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/cpp -lang-c++ -nostdinc++ -v -I. -I. -I.. -I.. -I../stl -I../libio -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) -D__EXCEPTIONS -g -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di486 -D__i486 -D__i486__ -D__PIC__ -D__pic__ -DHAVE_CONFIG_H -D_GNU_SOURCE -DPIC misc-inst.cc misc-inst.ii
GNU CPP version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 .
 ..
 ../stl
 ../libio
 /usr/local/include
 /usr/i486-linux/include
 /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/cc1plus misc-inst.ii -quiet -dumpbase misc-inst.cc -g -version -fno-implicit-templates -fimplicit-templates -fPIC -o misc-inst.s
GNU C++ version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i486-linux) compiled by GNU C version egcs-2.91.60 19981201 (egcs-1.1.1 release).
../bits/std_ostream.h: In function `class basic_ostream<char,char_traits<char> > & operator <<<char_traits<char>>(class basic_ostream<char,char_traits<char> > &, const char *)':
misc-inst.cc:100:    instantiated from here
../bits/std_ostream.h:425: Internal compiler error.
../bits/std_ostream.h:425: Please submit a full bug report to `egcs-bugs@cygnus.com'.
../bits/std_ostream.h:425: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for details.

and the corresponding .ii file:

--
Jens Krueger
VSA GmbH
Tomannweg 6
D-81673 Muenchen
Tel: +49 89 431 84 213
Fax: +49 89 431 84 281
mailto:jens.krueger@vsa.de
http://www.vsa.de

[-- Attachment #2: misc-inst.ii.gz --]
[-- Type: application/x-gzip, Size: 66720 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Compiler error
@ 1999-04-30 23:15 rbrought
  0 siblings, 0 replies; 24+ messages in thread
From: rbrought @ 1999-04-30 23:15 UTC (permalink / raw)
  To: egcs-bugs

This is with 2.7.2.3. The source to kformula.cc is attached.
-----

kformula.cc: In method `double KFormula::evaluate(class QStrList, class
QArray<double>, int * = 0, class box * = 0)':
kformula.cc:351: Internal compiler error.
kformula.cc:351: Please submit a full bug report to `egcs-bugs@cygnus.com'.
make: *** [kformula.lo] Error 1

-----
Bob Broughton
mailto:rbrought@canadawired.com
WWW: http://canadawired.com/~rbrought
Vancouver, BC, Canada
>From ildar@faki-campus.mipt.ru Fri Apr 30 23:15:00 1999
From: Ildar Mulyukov <ildar@faki-campus.mipt.ru>
To: egcs-bugs@egcs.cygnus.com
Subject: Re: TODO: egcs-g++ (fwd)
Date: Fri, 30 Apr 1999 23:15:00 -0000
Message-id: <Pine.LNX.4.04.9904100953020.22772-100000@natalie.faki-campus.mipt.ru>
X-SW-Source: 1999-04n/msg00294.html
Content-length: 1476

Ildar Mulyukov, student of DACR, MIPT (Moscow, Russia)
e-mail: ildar@faki-campus.mipt.ru, ICQ# 4334029

---------- Forwarded message ----------
Date: 10 Apr 1999 02:40:32 -0300
From: Alexandre Oliva <oliva@dcc.unicamp.br>
To: Ildar Mulyukov <ildar@faki-campus.mipt.ru>
Cc: egcs@egcs.cygnus.com
Subject: Re: TODO: egcs-g++

On Apr 10, 1999, Ildar Mulyukov <ildar@faki-campus.mipt.ru> wrote:

> But when I just started using egcs c++ I encountered 2 problems.

Nope, egcs did encounter 2 problems :-D

> struct _stru {
>     int i;
>     union {
>         struct { int j0, j1; };
                                ^ some variable name is missing here
>         int j[2];
>     }
       ^ struct and union declarations must be terminated with `;'
> };

> The worst thing is that TinySoft's VisualC++ eats it ok :-)

Send them a bug report then :-)

> 2. Compiling dos-formatted files (CR-LF instead of LF) invokes no problem
> except when one ends line with '\'. While CR comes straight after \
> compiler thinks it is special symbol and emits an error.

AFAIK, this is not supposed to work, but, if it works at all, it would
probably only work in MS-DOS like platforms.  But I'm not sure about
that.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Brasil
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists



^ permalink raw reply	[flat|nested] 24+ messages in thread
* Compiler error
@ 1999-03-31 23:54 Sheldon Lee Wen
  1999-03-23 23:13 ` Alexandre Oliva
  0 siblings, 1 reply; 24+ messages in thread
From: Sheldon Lee Wen @ 1999-03-31 23:54 UTC (permalink / raw)
  To: egcs-bugs

HI,

I'm being a good boy and reporting this:

I was compiling vdkbuilder.


[root@localhost vdkbuilder]# gcc  -c -g -Wall -DVDKBDEBUG -DHAVE_SYNTAX -DHAVE_HINTS -I./ `vdk-config --cflags` -o vdkb_editor.o vdkb_editor.c
c
vdkb_editor.cc:44: warning: ANSI C++ forbids declaration `last_pos' with no type
/usr/local/include/vdk/vdkbtrees.h: In instantiation of `RedBlackNode<VDKBHint>':
/usr/local/include/vdk/vdkbtrees.h:555:   instantiated from `AbstractBinaryTree<VDKBHint,RedBlackNode<VDKBHint> >::find<VDKBHint, RedBlackNode<VDKBHint>>(const VDKBHint &)'
vdkb_editor.cc:57:   instantiated from here
/usr/local/include/vdk/vdkbtrees.h:555: Internal compiler error.
/usr/local/include/vdk/vdkbtrees.h:555: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
/usr/local/include/vdk/vdkbtrees.h:555: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for details.
/*
 * ===========================
 * VDK Visual Development Kit
 * Version 0.5
 * November 1998
 * ===========================
 *
 * Copyright (C) 1998, Mario Motta
 * Developed by Mario Motta <mmotta@guest.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 */

#ifndef VDKBTREES_H
#define VDKBTREES_H

// --------------------------
// Abstract  class template, 
// --------------------------
template<class T, class Node>
class AbstractBinaryNode {
public:
    AbstractBinaryNode() { }
    AbstractBinaryNode(const T& _object, 
               Node *_parent = 0, 
               Node *_left = 0, 
               Node *_right = 0);
    virtual ~AbstractBinaryNode() { }

    // Subtree arrangement
    virtual Node *Clone(Node *_parent) const;
    virtual void RemoveSubtree();
    virtual Node *LeftRotate(Node *root);
    virtual Node *RightRotate(Node *root);
    virtual int CheckTreeProperties(const Node *);
    virtual int IsLeftChild() const;
    virtual int IsRightChild() const;
    // Adding a node and deleting
    virtual Node *add(const T& x);
    virtual Node *unlink(Node *z);

    // Find
    virtual Node *find(const T& x);
    virtual Node *findNearest(const T& x);

    // Tree trasverse
    virtual Node *Minimum();
    virtual Node *Maximum();
    virtual Node *Predecessor();
    virtual Node *Successor();

    // Miscellaneous
    virtual T *Object();

public:
    T object;
    Node *left, *right, *parent;

};

template<class T>
class BinaryNode : public AbstractBinaryNode<T, BinaryNode<T> > {
public:
    // Constructors and destructor
    BinaryNode() { }
    BinaryNode(const T& object, 
               BinaryNode<T> *parent = 0, 
               BinaryNode<T> *left = 0, 
               BinaryNode<T> *right = 0):
        AbstractBinaryNode<T, BinaryNode<T> >(object, parent, left, right) { }
    virtual ~BinaryNode() { }
};

//////////////////////////////////////////////////////
// Different ways to iterate on the binary tree.

enum BtreeIteratorMode { BtMinKey, BtRootKey, BtMaxKey };

template<class T, class Node>
class AbstractBinaryTree {

public:

    AbstractBinaryTree();
    AbstractBinaryTree(const AbstractBinaryTree<T, Node>&);
    AbstractBinaryTree<T, Node>& operator=(const AbstractBinaryTree<T, Node>&);
    virtual ~AbstractBinaryTree();


    virtual void add(const T&);      // Add a node
    virtual void unlink(const T&);      // Remove a node
    virtual T *find(const T& q);
    virtual int IsEmpty() const { return root == 0; }


    virtual Node *IteratorRoot() const;
    virtual Node *IteratorFind(const T& x) const;
    virtual int CheckTreeProperties();
    unsigned int size() { return count; }
    // Iterator class 
    class Iterator {

    public:
        Iterator(const AbstractBinaryTree<T, Node>& _tree, 
                 enum BtreeIteratorMode start = BtMinKey) 
        {
            tree = (AbstractBinaryTree<T, Node> *) (&_tree);
            StartAt(start);
        }

        // Start iterator over at the minimum, maximum or
        // root node of the binary tree.
        void StartAt(enum BtreeIteratorMode start) 
        {
            ptr = tree->IteratorRoot();
            if (start == BtMinKey)
                ptr = ptr->Minimum();
            else if (start == BtMaxKey)
                ptr = ptr->Maximum();
        }

        virtual ~Iterator() { }

        virtual void Previous() 
        {
            if (ptr)
                ptr = ptr->Predecessor();
        }

        virtual void Next() 
        {
            if (ptr)
                ptr = ptr->Successor();
        }

        virtual void Parent() 
        {
            if (ptr)
                ptr = ptr->parent;
        }

        virtual void find(const T& x) 
        {
            ptr = tree->IteratorFind(x);
        }

        virtual operator int() const 
        {
            return ptr != 0;
        }

        // Dereferencing operator returns the object of the
        // node currently pointed to by the iterator.
        virtual T operator*() const {  return ptr->object; }
	virtual T current() const {  return ptr->object; }

	virtual Node* current_node() const
	  { return ptr; }
        // Object returns a pointer to the object of the
        // node currently pointed to (as opposed to returning
        // a copy of the node, as the dereferencing operator
        // above does).
        virtual const T *Object() const 
        {
            if (ptr)
                return &ptr->object;
            return (T*) 0;
        }
        virtual T *Object() 
        {
            if (ptr)
                return &ptr->object;
            return 0;
        }

        virtual void operator++() { Next(); }
        virtual void operator++(int) { Next(); }
        virtual void operator--() { Previous(); }
        virtual void operator--(int) { Previous(); }

    protected:
        Node *ptr;
        AbstractBinaryTree<T, Node> *tree;
    };

protected:
    Node *root;
    unsigned int count;
};

///////////////////////////////////////
template<class T>
class BinaryTree : public AbstractBinaryTree<T, BinaryNode<T> > {
public:
    BinaryTree() { }
};



// --------------------------------------------------------
// AbstractBinaryNode implementation.
// --------------------------------------------------------
template<class T, class Node>
AbstractBinaryNode<T, Node>::AbstractBinaryNode(const T& _object, 
                          Node *_parent,
                          Node *_left, 
                          Node *_right) 
{
    object = _object;
    parent = _parent;
    left = _left;
    right = _right;
}

template<class T, class Node>
Node *
AbstractBinaryNode<T, Node>::Clone(Node *_parent) const
{
    Node *ret = new Node( *((Node *) this));
    if (left)
        ret->left = left->Clone(ret);
    if (right)
        ret->right = right->Clone(ret);
    ret->parent = _parent;
    return ret;
}

template<class T, class Node> 
Node *
AbstractBinaryNode<T, Node>::LeftRotate(Node *root)
{
    Node *ret = root;
    Node *y = right;
    right = y->left;
    if (right)
        right->parent = (Node *) this;
    y->parent = parent;
    if (parent) {
        if (this == parent->left)
            parent->left = y;
        else
            parent->right = y;
    }
    else
        ret = y;
    y->left = (Node *) this;
    parent = y;
    return ret;
}

template<class T, class Node> 
Node *
AbstractBinaryNode<T, Node>::RightRotate(Node *root)
{
    Node *ret = root;
    Node *x = left;
    left = x->right;
    if (left)
        left->parent = (Node *) this;
    x->parent = parent;
    if (parent) {
        if (this == parent->left)
          parent->left = x;
        else
          parent->right = x;
    }
    else
        ret = x;
    x->right = (Node *) this;
    parent = x;
    return ret;
}

template<class T, class Node>
int
AbstractBinaryNode<T, Node>::IsLeftChild() const
{
    return (parent && parent->left == (Node *) this);
}

template<class T, class Node>
int
AbstractBinaryNode<T, Node>::IsRightChild() const
{
    return (parent && parent->right == (Node *) this);
}

template<class T, class Node>
Node *
AbstractBinaryNode<T, Node>::find(const T& x)
{
    Node *sc = (Node *) this;
    while (sc) {
        if (x == sc->object)
            return sc;
        if (x < sc->object)
            sc = sc->left;
        else
            sc = sc->right;
    }
    return 0;
}

template<class T, class Node>
Node *
AbstractBinaryNode<T, Node>::findNearest(const T& x)
{
    Node *sc = (Node *) this;
    Node *prev = 0;
    while (sc) {
        prev = sc;
        if (x < sc->object)
            sc = sc->left;
        else
            sc = sc->right;
    }
    return prev;
}

template<class T, class Node>
Node *
AbstractBinaryNode<T, Node>::add(const T& x) 
{
    Node *nearest = findNearest(x);
    if (x < nearest->object)
        nearest->left = new Node(x, nearest);
    else
        nearest->right = new Node(x, nearest);
    return (Node *) this;
}

template<class T, class Node>
Node *
AbstractBinaryNode<T, Node>::unlink(Node *z)
{
    Node *root = (Node *) this;
    Node *x, *y;
    if (! z)
        return root;
    if (! z->left || ! z->right)
        y = z;
    else
        y = z->Successor();
    if (y->left)
        x = y->left;
    else
        x = y->right;
    if (x)
        x->parent = y->parent;
    if (y->parent) {
        if (y == y->parent->left)
            y->parent->left = x;
        else
            y->parent->right = x;
    }
    else
        root = x;
    if (y != z)
        z->object = y->object;
    delete y;
    return root;
}

template<class T, class Node>
Node *
AbstractBinaryNode<T, Node>::Minimum()
{
    Node *sc = (Node *) this;
    while (sc && sc->left)
        sc = sc->left;
    return sc;
}

template<class T, class Node>
Node *
AbstractBinaryNode<T, Node>::Maximum()
{
    Node *sc = (Node *) this;
    while (sc && sc->right)
        sc = sc->right;
    return sc;
}

template<class T, class Node>
Node *
AbstractBinaryNode<T, Node>::Predecessor()
{
    if (left)
        return left->Maximum();
    Node *x = (Node *) this;
    Node *y = parent;
    while (y && x == y->left) {
        x = y;
        y = y->parent;
    }
    return y;
}

template<class T, class Node>
Node *
AbstractBinaryNode<T, Node>::Successor() 
{
    if (right)
        return right->Minimum();
    Node *x = (Node *) this;
    Node *y = parent;
    while (y && x == y->right) {
        x = y;
        y = y->parent;
    }
    return y;
}

template<class T, class Node>
void
AbstractBinaryNode<T, Node>::RemoveSubtree()
{
    if (left) {
        left->RemoveSubtree();
        delete  left;
    }
    if (right) {
        right->RemoveSubtree();
        delete right;
    }
}

template<class T, class Node>
T *
AbstractBinaryNode<T, Node>::Object()
{
    return &object;
}

template<class T, class Node>
int
AbstractBinaryNode<T, Node>::CheckTreeProperties(const Node *_parent)
{
    if (parent != _parent)
        return 0;
    if (left) {
        if (object < left->object)
            return 0;
        if (! left->CheckTreeProperties((Node *) this))
            return 0;
    }
    if (right) {
        if (right->object < object)
            return 0;
        if (! right->CheckTreeProperties((Node *) this))
            return 0;
    }
    return 1;
}

// --------------------------------------------------------
// AbstractBinaryTree class template implementation.
// --------------------------------------------------------

template<class T, class Node>
AbstractBinaryTree<T, Node>::AbstractBinaryTree()
{
    root = 0;
    count = 0;
}

template<class T, class Node>
AbstractBinaryTree<T, Node>::AbstractBinaryTree(const AbstractBinaryTree<T, Node>& x)
{
    if (x.root)
        root = x.root->Clone(0);
    else
        root = 0;
    count = x.count;
}

template<class T, class Node>
AbstractBinaryTree<T, Node>&
AbstractBinaryTree<T, Node>::operator=(const AbstractBinaryTree<T, Node>& x)
{
    if (root) {
        root->RemoveSubtree();
        delete root;
    }
    if (x.root)
        root = x.root->Clone(0);
    else
        root = 0;
    count = x.count;
    return *this;
}

template<class T, class Node>
AbstractBinaryTree<T, Node>::~AbstractBinaryTree()
{
    if (root) {
        root->RemoveSubtree();
        delete root;
    }
} 

template<class T, class Node>
void
AbstractBinaryTree<T, Node>::add(const T& x)
{
  count++;
  if (root == 0)
    root = new Node(x);
  else
    root = root->add(x);
}

template<class T, class Node>
Node *
AbstractBinaryTree<T, Node>::IteratorRoot() const
{
    return root;
}

template<class T, class Node>
Node *
AbstractBinaryTree<T, Node>::IteratorFind(const T& x) const
{
    return (root) ? root->find(x) : 0;
}

template<class T, class Node>
void
AbstractBinaryTree<T, Node>::unlink(const T& _x)
{
  count--;
  if (! root)
    return;
  root = root->unlink(root->find(_x));
}

template<class T, class Node>
T *
AbstractBinaryTree<T, Node>::find(const T& q)
{
    Node *p = (root) ? root->find(q) : 0;
    return (p) ? &p->object : 0;
}

template<class T, class Node>
int
AbstractBinaryTree<T, Node>::CheckTreeProperties()
{
  if (root->CheckTreeProperties(0) == 0)
    return 0;
  return 1;
}

/////////////////////////////
// balanced binary trees 
// (using red & black trees)
/////////////////////////////
template<class T, class Node>
class AbstractRedBlackNode : public AbstractBinaryNode<T, Node> {
public:

    enum RedBlack { Black, Red } clr;

    // Constructors.  Node always starts out red.
    AbstractRedBlackNode() { clr = Red; }
    AbstractRedBlackNode(const T& X, 
                 Node *P = 0,
                 Node *L = 0,
                 Node *R = 0):
        AbstractBinaryNode<T, Node>(X, P, L, R) { }
    AbstractRedBlackNode(const T& X, enum RedBlack Clr, Node *P = 0,
            Node *L = 0, Node *R = 0):
        AbstractBinaryNode<T, Node>(X, P, L, R), clr(Clr) { }
    virtual ~AbstractRedBlackNode() { }

    // Tree manipulations used during insertion and deletion
    virtual Node *RemoveFixup(Node *x, Node *p);
    
    // Operations defined on binary trees.  All run in O(lgN) time.
    virtual Node *add(const T& AddMe);
    virtual Node *unlink(Node *z);
    
    // Returns 0 if the red-black invariant holds.
    virtual int CheckTreeProperties(const Node *);
};

template<class T>
class RedBlackNode : public AbstractRedBlackNode<T, RedBlackNode<T> > {
public:
    // Constructors.  Node always starts out red.
    RedBlackNode() { }
    RedBlackNode(const T& X, 
                 RedBlackNode<T> *P = 0,
                 RedBlackNode<T> *L = 0,
                 RedBlackNode<T> *R = 0):
        AbstractRedBlackNode<T, RedBlackNode<T> >(X, P, L, R) { }
    RedBlackNode(const T& X, enum RedBlack Clr, RedBlackNode<T> *P = 0,
            RedBlackNode<T> *L = 0, RedBlackNode<T> *R = 0):
        AbstractRedBlackNode<T, RedBlackNode<T> >(X, clr, P, L, R) { }
    virtual ~RedBlackNode() { }
};


// --------------------------------------------------------
// AbstractRedBlackTree class template.
// --------------------------------------------------------
template<class T, class Node> 
class AbstractRedBlackTree : public AbstractBinaryTree<T, Node> {
// The following is accessible only to classes that inherit
// from AbstractRedBlackTree, since they deal directly with RedBlackNodes.
protected:
    virtual Node *FindNode(T q) const
        { return (root) ? (Node *) root->find(q) : 0; }
};

template <class T>
class VDKBtree : public AbstractRedBlackTree<T, RedBlackNode<T> > {
public:
    VDKBtree() { }
};



template<class T, class Node> 
Node *
AbstractRedBlackNode<T, Node>::add(const T& AddMe)
{
    Node *root = (Node *) this;
    Node *x = (Node *) this;
    Node *y = 0;
    while (x) {
        y = x;
        x = (AddMe < x->object) ? x->left : x->right;
    }
    Node *addme = new Node(AddMe, y);
    if (! y)
        root = addme;
    else {
      if (AddMe < y->object)
          y->left = addme;
      else
          y->right = addme;
    }
    addme->clr = Red;
    while (addme != root && 
           addme->parent->parent && 
           addme->parent->clr == Red) {
        Node *y;

        if (addme->parent == addme->parent->parent->left) {
            y = addme->parent->parent->right;
            if (y && y->clr == Red) {
                // Case 1: x's uncle is red
                addme->parent->clr = Black;
                y->clr = Black;
                addme->parent->parent->clr = Red;
                addme = addme->parent->parent;
            }
            else {
                if (addme == addme->parent->right) {
                    // Case 2: x is a right child
                    // Rotate to transform to case 3
                    addme = addme->parent;
                    root = addme->LeftRotate(root);
                }
                // Case 3: x is a left child
                addme->parent->clr = Black;
                if (addme->parent->parent) {
                    addme->parent->parent->clr = Red;
                    root = addme->parent->parent->RightRotate(root);
                }
                // The while loop will terminate 
                // on the next iteration.
            }
        }
        else {
            y = addme->parent->parent->left;
            if (y && y->clr == Red) {
                addme->parent->clr = Black;
                y->clr = Black;
                addme->parent->parent->clr = Red;
                addme = addme->parent->parent;
            }
            else {
                if (addme == addme->parent->left) {
                  addme = addme->parent;
                  root = addme->RightRotate(root);
                }
                addme->parent->clr = Black;
                if (addme->parent->parent) {
                    addme->parent->parent->clr = Red;
                    root = addme->parent->parent->LeftRotate(root);
                }
            }
        }
    }
    root->clr = Black;
    return root;
}

template<class T, class Node> 
Node *
AbstractRedBlackNode<T, Node>::RemoveFixup(Node *x, Node *p)
{
    Node *root = (Node *) this;

    while (x != root && (! x || x->clr == Black)) {
        Node *w;
        if (x == p->left) {
            if (! p)
                return root;
            w = p->right;
            if (! w)
                return root;
            if (w->clr == Red) {
                w->clr = Black;
                p->clr = Red;
                root = p->LeftRotate(root);
                w = p->right;
                if (! p || ! w)
                    return root;
            }
            if ( ((! w->left) || w->left->clr == Black) &&
                 ((! w->right) || w->right->clr == Black)) {
                  w->clr = Red;
                  x = p;
                  p = p->parent;
                  continue;
            }
            else if ((! w->right) || w->right->clr == Black) {
                w->left->clr = Black;
                w->clr = Red;
                root = w->RightRotate(root);
                w = p->right;
                if (! p || ! w)
                    return root;
            }
            w->clr = p->clr;
            if (p)
                p->clr = Black;
            w->right->clr = Black;
            if (p)
                root = p->LeftRotate(root);
            x = root;
        }
        else {
            if (! p)
                return root;
            w = p->left;
            if (! p || ! w)
                return root;
            if (w->clr == Red) {
                w->clr = Black;
                p->clr = Red;
                root = p->RightRotate(root);
                w = p->left;
                if (! p || ! w)
                    return root;
            }
            if ( ((! w->right) || w->right->clr == Black) &&
                 ((! w->left) || w->left->clr == Black)) {
                w->clr = Red;
                x = p;
                p = p->parent;
                continue;
            }
            else if ((! w->left) || w->left->clr == Black) {
                w->right->clr = Black;
                w->clr = Red;
                root = w->LeftRotate(root);
                w = p->left;
                if (! p || ! w)
                    return root;
            }
            w->clr = p->clr;
            if (p)
                p->clr = Black;
            w->left->clr = Black;
            if (p)
                root = p->RightRotate(root);
            x = root;
        }
    }
    if (x)
        x->clr = Black;
    return root;
}

template<class T, class Node> 
Node *
AbstractRedBlackNode<T, Node>::unlink(Node *z)
{
    Node *root = (Node *) this;
    Node *x, *y;

    if (! z)
        return root;
    y = (! z->left || ! z->right) ? z : (Node *) z->Successor();
    x = (y->left) ? y->left : y->right;

    if (x)
        x->parent = y->parent;

    if (y->parent) {
        if (y == y->parent->left)
            y->parent->left = x;
        else
            y->parent->right = x;
    }
    else
        root = x;
    if (y != z)
        z->object = y->object;
    if (y->clr == Black) {
        if (root)
            root = root->RemoveFixup(x, y->parent);
    }
    delete y;
    return root;
}

template<class T, class Node> 
int
AbstractRedBlackNode<T, Node>::CheckTreeProperties(const Node *_parent)
{
    static int BlackHeight;

    if (_parent == 0)
        BlackHeight = -1;

    // Check binary tree properties.
    if (parent != _parent)
        return 0;
    if (left) {
        if (object < left->object)
            return 0;
    }
    if (right) {
        if (right->object < object)
            return 0;
    }

    // Now check red-black tree properties.

    // If a node is red, then both its children are black
    // (NULL nodes are black).
    if (clr == Red) {
        if ((left && left->clr != Black) ||
            (right && right->clr != Black))
            return 0;
    }

    // The black-heights of all leaf nodes are equal.
    int bh = 0;

    if ((! left) && (! right)) {
        // Compute black-height of node
        for (Node *sc = (Node *) this; sc; sc = sc->parent)
            if (sc->clr == Black)
                bh += 1;

        if (BlackHeight == -1) {
            BlackHeight = bh;
        }
        else {
            if (bh != BlackHeight)
                return 0;
        }
    }
    if (left && (! left->CheckTreeProperties((Node *) this)))
        return 0;
    if (right && (! right->CheckTreeProperties((Node *) this)))
        return 0;
    return 1;
}
#endif






^ permalink raw reply	[flat|nested] 24+ messages in thread
* compiler error
@ 1999-01-05  5:21 Johannus Noordanus
  0 siblings, 0 replies; 24+ messages in thread
From: Johannus Noordanus @ 1999-01-05  5:21 UTC (permalink / raw)
  To: egcs-bugs

When compiling the test2.cc program (see attachment), the following
error occurred:

DOWNLOAD/AVLTREE/AvlTrees/TEST > g++ test2.cc
test2.cc: In method `void Link::setLink(class Link *)':
test2.cc:32: Internal compiler error.
test2.cc:32: Please submit a full bug report to `egcs-bugs@cygnus.com'.
DOWNLOAD/AVLTREE/AvlTrees/TEST > 

I think my code is wrong, but it should not result in a compiler error.

Thanks (if you want to look at it),

Johannes







P.S. 
The compiler version is:
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
#include <stdio.h>

void aap(int x,int y)
{
};

int noot(int x,int y)
{
    return 10;
};

class Link 
{

//    typedef void (*mytype)(void);
    public:
	Link *next;

	Link()
	{ next = (Link *) 0;
          printf("hallo \n");
          hallo=&aap1;
	}

	Link(int a)
	{ next = (Link *) 0;
          printf("integer: %d \n",a);}

	void setLink(Link *n)
	{ 
	   next = n;
	   this->hallo();
	}

	void add(Link *n)
	{ if (next) next->add(n); else setLink(n); }
	
	void onEachDo(void f(Link *))
	{ f(this); if (next) next->onEachDo(f); }
    
 	virtual print()
        { printf("HALLO....\n"); }

	void aap1()
	{}

	static void display(Link *x)
	{ x->print(); }

//	mytype hallo;
	void (Link::*hallo)(void);
}; 

class LinkedList 
{
    public:
	Link *elements;

	LinkedList()
	{ elements = (Link *) 0; }

	void add(Link *n)
	{ if (elements) elements->add(n); else elements = n; }
	
	void onEachDo(void f(Link *))
	{ if (elements) elements->onEachDo(f); }
}; 

// void (*hallo)(void);

class IntegerLink: public Link
{
    int value;

    public:
	IntegerLink(int i) : Link()
	{ value = i; }

    print()
    { printf("%d\n", value); }
};

main()
{
    void (*hop)(int,int) = aap;

    Link	hallo1;
    Link	daar(10);

    LinkedList list;

    IntegerLink *list1;
    Link        *list2;

    list2 = list1;

    list.add(new IntegerLink(3));
    list.add(new IntegerLink(17));
    list.add(new IntegerLink(32));

    list.onEachDo(Link::display);
    noot(10,11);
}
>From tdumont@lan.univ-lyon1.fr Tue Jan 05 05:21:00 1999
From: Thierry Dumont <tdumont@lan.univ-lyon1.fr>
To: egcs-bugs@cygnus.com
Subject: Bug ?
Date: Tue, 05 Jan 1999 05:21:00 -0000
Message-id: <Pine.LNX.3.96.990105134839.14067A-500000@mobylette.univ-lyon1.fr>
X-SW-Source: 1999-01/msg00061.html
Content-length: 907

Hello...
At least something strange ...

I have a class which compile well with optimisation (-O or -O1, O2, O3), but
the compiler crashes without optimisation.

System : linux redhat 5.1/i386.
egcs   : Reading specs from 
         /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.90.27/specs
         gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
options : none except optomisation when used, and path to include files.

You will find attached :
 - the header  stokes.h
 - the corresponding stokes.cc
 - the template gcp.h used by stokes.cc
 - what the compiler says...

I hope it will be usefull...

t.d.
--
Thierry Dumont.        Analyse Numerique Lyon-Saint Etienne (UMR 5585 CNRS).
Univ. Lyon I,43 Bd du 11 Novembre 1918, 69622 - Villeurbanne Cedex - France.
tel./phone : (33) 04 72 44 85 23.   fax : (33) 04 72 44 80 53.
e-mail :tdumont@lan1.univ-lyon1.fr  web: http://numerix.univ-lyon1.fr/~tdumont


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Compiler Error.
@ 1998-09-30 10:52 Ed Hagopian
  1998-10-01 21:38 ` Alexandre Oliva
  0 siblings, 1 reply; 24+ messages in thread
From: Ed Hagopian @ 1998-09-30 10:52 UTC (permalink / raw)
  To: egcs-bugs

[spesh@localhost nurbs-2.1-19980924]# make install
(cd src;make install)
make[1]: Entering directory `/tmp/nurbs-2.1-19980924/src'
c++ -c -g -O2 -fno-implicit-templates  -I/usr/local/include     -I/usr/local/include -I../include nurbs.cc
nurbs.cc: In method `int PlNurbsCurve<float>::writePSp(const char *, const class PlVector<Point_3D<float> > &, const class PlVector<Point_3D<float> > &, int = 0, float = 0x000000000000000000000000, float = 0x000000000000000000a00140) const':
nurbs.cc:3762: Internal compiler error.
nurbs.cc:3762: Please submit a full bug report to `egcs-bugs@cygnus.com'.
make[1]: *** [nurbs.o] Error 1
make[1]: Leaving directory `/tmp/nurbs-2.1-19980924/src'
make: *** [install] Error 2



The above was generated after I tried to compile the nurbs libs for an eventual
use in MindsEye, any and all help would be appriciated.

-- 
- Professional Services & Support Department -*- proservices@execpc.com -
		- Ed Hagopian -*- ehgopian@execpc.com -


^ permalink raw reply	[flat|nested] 24+ messages in thread
[parent not found: <9809170119.AA09596@tsunami.harvard.edu>]
* Compiler error
@ 1998-05-21 10:20 Chuck Robey
  0 siblings, 0 replies; 24+ messages in thread
From: Chuck Robey @ 1998-05-21 10:20 UTC (permalink / raw)
  To: egcs-bugs

I was experimenting with egcs, trying to see if it maybe could find a
way around a problem I've been having with the latest release of octave
(2.0.12).  My goal was octave, egcs was a possible step along the way.
with gcc 2.7.2.1, it links but doesn't run coreectly.

While doing the compile:

/usr/local/bin/eg++ -c  -I. -I.. -I../liboctave -I../src
-I../libcruft/misc   -DHAVE_CONFIG_H -mieee-fp -fno-rtti -fno-exceptions
-fno-implicit-templates -g -O2 -Wall Array3.cc
Array3.h: In method `Array3<T>::Array3(T *, int, int, int)':
In file included from Array3.cc:36:
Array3.h:52: Internal compiler error 388.
Array3.h:52: Please submit a full bug report to `egcs-bugs@cygnus.com'.
gmake[2]: *** [Array3.o] Error 1
gmake[2]: Leaving directory
`/usr2/chuckr/octave/work/octave-2.0.12/liboctave'
gmake[1]: *** [liboctave] Error 2

Let me know if there's anything else you want submitted for the bug
report, ok?

----------------------------+-----------------------------------------------
Chuck Robey                 | Interests include any kind of voice or data 
chuckr@glue.umd.edu         | communications topic, C programming, and Unix.
213 Lakeside Drive Apt T-1  |
Greenbelt, MD 20770         | I run Journey2 and picnic (FreeBSD-current)
(301) 220-2114              | and jaunt (NetBSD).
----------------------------+-----------------------------------------------






^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2001-04-11 18:56 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-31 21:06 Compiler Error linneman
1999-05-23  1:03 ` Martin v. Loewis
1999-05-24  5:40   ` linneman
1999-05-31 21:06     ` Martin v. Loewis
1999-05-31 21:06       ` Otto Linnemann
1999-05-31 21:06         ` Martin v. Loewis
  -- strict thread matches above, loose matches on Subject: below --
2001-04-11 17:51 Compiler error M.Wilkens
2001-04-11 18:56 ` Alexandre Oliva
     [not found] <00033016040105.02815@kanga.pjprimer.com>
2000-03-30 15:42 ` compiler error Alexandre Oliva
     [not found] <388C2FFC.50C337EE@mp-sun1.informatik.uni-mannheim.de>
2000-01-24  3:23 ` Alexandre Oliva
1999-11-12 22:39 Compiler error Jake Kreutzer
1999-11-15 16:21 ` Alexandre Oliva
1999-11-03  0:41 compiler error Trevor Spiteri
1999-11-30 23:39 ` Nathan Sidwell
1999-07-31 23:33 Jens Krüger
1999-07-16  0:26 ` Martin v. Loewis
1999-04-30 23:15 Compiler error rbrought
1999-03-31 23:54 Sheldon Lee Wen
1999-03-23 23:13 ` Alexandre Oliva
1999-01-05  5:21 compiler error Johannus Noordanus
1998-09-30 10:52 Compiler Error Ed Hagopian
1998-10-01 21:38 ` Alexandre Oliva
     [not found] <9809170119.AA09596@tsunami.harvard.edu>
1998-09-17 11:50 ` Compiler error Alexandre Oliva
1998-05-21 10:20 Chuck Robey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).